inverse download

Hello,

in a web app, can the client to download some files from the server like File Uploader?
Thank You.

Yes. Look at WebFile and WebLink.

Thank you, i want to use WebFile but i do not know how to use it… Can you make an example?

You have an example here
http://documentation.xojo.com/index.php/WebFile

ok, but in this example the app.myfile what is?

if i have:

dim fli as folderitem
dim locfli as webfile

fli = new folderitem("ciccio")
locfli = new webfile
locfli.forcedownload = true
locfli = webfile.open(fli)
showurl(locfli.url)

i have from browser: 404 file not found

why? where is my error?

thank you for help

“locfli” cannot be a local method variable because it will go out of scope before the download can even start. Instead make it a property of the page.

For more information:

as stated in the comment within the code, myFile is a WebFile property of App. To add a property to an object, right click on it and select Add/Property.

That is necessary to prevent the file to disappear at the end of the event, which is the cause for your 404 error.

woderful: it work!
Thank you Bob, Paul & Michel…!

If I use this

[code]
app.locfli = new WebFile

app.locfli.ForceDownload=True
app.locfli = WebFile.Open(fli)

ShowURL(app.locfli.URL)[/code]

Can the client to open the WebFile into a new window ?
Or can the user to just download the file directly into his download folder?

I find the solution:
ShowURL(app.locfli.URL, True)

where “true” mean innewwindow value…