Page 1 of 1
Download File using a Revlet
Posted: Fri Dec 11, 2009 3:48 pm
by reelstuff
I have been trying to find a simple yet fairly secure method of using the revlet to download
a file from the internet,
Code: Select all
on mouseUp
answer "Your Download will start in just a moment"
put fld "S3File" into tURL
launch url tURL
--also tried revGoURL, load URL, ect, to no avail, so it is obvious that this functionality does not yet exist,
end mouseUp
Does anyone know what functions are available to the current version of the revlet?
is there a simple method of downloading a file from a URL to the users computer or browser ect, any easy way to get that file to the user.
Tim
Re: Download File using a Revlet
Posted: Fri Dec 11, 2009 5:09 pm
by bn
Tim,
this works for me in a revlet. About security I don't know. You will want to decide on the saving location, which is the desktop in this case.
Code: Select all
on mouseUp
put "http://NameOfYourDomain.com/testfile/presets/prefs.txt" into myPath
put url myPath && the long time into field 1 -- just for testing purposes
put url myPath into myVariable
put specialFolderPath(desktop) & "/" into tPathToDesktop
set the itemdelimiter to "/"
put item - 1 of myPath after tPathToDesktop
put myVariable into url ("file:" & tPathToDesktop)
end mouseUp
the file is in a sub-sub-folder of the public folder, you have to adjust that, other than that it just works.
If it is a text file you can test in your browser whether the url works or not.
regards
Bernd
Re: Download File using a Revlet
Posted: Fri Dec 11, 2009 5:26 pm
by reelstuff
bn wrote:Tim,
this works for me in a revlet. About security I don't know. You will want to decide on the saving location, which is the desktop in this case.
Code: Select all
on mouseUp
put "http://NameOfYourDomain.com/testfile/presets/prefs.txt" into myPath
put url myPath && the long time into field 1 -- just for testing purposes
put url myPath into myVariable
put specialFolderPath(desktop) & "/" into tPathToDesktop
set the itemdelimiter to "/"
put item - 1 of myPath after tPathToDesktop
put myVariable into url ("file:" & tPathToDesktop)
end mouseUp
the file is in a sub-sub-folder of the public folder, you have to adjust that, other than that it just works.
If it is a text file you can test in your browser whether the url works or not.
regards
Bernd
It does work, thank you, I was about to pull my hair out,
thank you for posting that,)