Launching LC stack from server, accessing file outside home

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
shawnblc
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 342
Joined: Fri Jun 01, 2012 11:11 pm

Launching LC stack from server, accessing file outside home

Post by shawnblc » Tue Mar 18, 2014 3:26 pm

Like php.

If I distribute an app with a splash screen that accesses the main application on the server, can that app that I upload to the server also access files outside of the public_html directory?

Example:

put url ("file:" & home/username/newdir/list.txt) into tList
answer tList

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Launching LC stack from server, accessing file outside h

Post by Klaus » Tue Mar 18, 2014 5:16 pm

HI Shawn,

not sure what you mean?
Do you access your "main application" (which is a livecode stack, I think?) with:
...
go url("http://www.some_server/folder/mainapp.livecode")
...
?

If yes, then no! :D
Since that stack is NOT on the server anymore, but on your machine.

If that is not what you mean, I need more info.


Best

Klaus

shawnblc
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 342
Joined: Fri Jun 01, 2012 11:11 pm

Re: Launching LC stack from server, accessing file outside h

Post by shawnblc » Tue Mar 18, 2014 8:52 pm

Splash screen -----> distributed to others
-----> splash screen accesses main app on the server
-------> main app on server accesses a text file on the same server that is outside of the home directory


Is that possible?

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Launching LC stack from server, accessing file outside h

Post by FourthWorld » Tue Mar 18, 2014 9:04 pm

For security reasons, Apache won't allow any client to access file outside the web root. But you can write a CGI to do that, since CGI's have all the permissions you do when you shell in.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

shawnblc
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 342
Joined: Fri Jun 01, 2012 11:11 pm

Re: Launching LC stack from server, accessing file outside h

Post by shawnblc » Tue Mar 18, 2014 10:25 pm

FourthWorld wrote:For security reasons, Apache won't allow any client to access file outside the web root. But you can write a CGI to do that, since CGI's have all the permissions you do when you shell in.
Gotcha. That's exactly what I was looking for. Thank you!


Update: tested and works. Thanks Richard.

Post Reply