Javascript and Lua

I’m creating a webpop up to display a local webpage.

My app downloads some files from an FTP to the temp “system.TemporaryDirectory”

I need to add these to a javascript array e.g.

var files=new Array();
files[0]=‘directory/file1.txt’;

My question is:

What is the “system.TemporaryDirectory” in relation to the root of my app? [import]uid: 31718 topic_id: 7174 reply_id: 307174[/import]

Within your app’s “sandbox” it’s stored in a folder /tmp however, I’m not sure if accessing the path is that simple.

Here’s an experiment you can do to find out the exact path of a temporary file:

[blockcode]
local path = system.pathForFile( “myfile.temp”, system.TemporaryDirectory )
print( tostring( path ) )
[/blockcode]

You *may* have to create that file first and set the write location to be system.TemporaryDirectory, but whether or not you have to do that, the code above should be adequate enough to give you the exact path to your temporary file.

[import]uid: 7849 topic_id: 7174 reply_id: 26567[/import]