Download folder ?

I can’t use showURL to download a folder?

downloadFile = webFile.open(app.appFolder.child(“circleCalcRio inFlight”))
showURL(downloadFile.URL)

any other way?

Make a zip archive of the folder and then deliver the archive instead :slight_smile:
Thomas Tempelmann has a class for that if it needs to be done using code.
http://www.tempel.org/RB/ZipPackage

yes, archive is only way to bundle folder in one download.

MBS Plugin can also do zip archives.

can y’all help a bit with zipArchive? issue 1: I can’t find the class zipArchiveBase.

Ok … I’ve got TT’s app creating my zip file “circleCalcInFlight.zip”. However when I download using showURL, I get from WinZip “Cannot open file ‘circleCalcInFlight (5).zip’. It does not appear to be a valid archive.”

When I open the file, it’s called NewZip.zip and it’s empty.

[quote=67219:@John Scanlan]Ok … I’ve got TT’s app creating my zip file “circleCalcInFlight.zip”. However when I download using showURL, I get from WinZip “Cannot open file ‘circleCalcInFlight (5).zip’. It does not appear to be a valid archive.”

When I open the file, it’s called NewZip.zip and it’s empty.[/quote]

You may want to download a test zip file with ShowURL to see if it is a problem with the download process, or with the way you create the zip.

Where is downloadFile declared? If it goes out of scope, it might be that the WebFile is getting destroyed before the browser can request it.

I’ve tried declaring downloadFile in a window, in session, and in app. Had the same problem with each.

The Method is in the window:

app.downloadFile = webFile.open(app.appFolder.child(“circleCalcInFlight.zip”))
if app.downloadFile <> nil then
showURL(app.downloadFile.URL)
else
end if

eh?

When I put the method in app, I got an error saying that “showURL” didn’t exist.

Instead of ShowURL, try

app.downloadFile.Download

also, you might want to check to see if the zip file actually exists…

While stepping thru the app, before opening it as a webfile and applying showURL, I tried to open the file and got this cannot open the file error: “Probable cause: file sharing or file permissions problem.”

When running the app without stepping thru, I get the “does not appear to be a valid archive” error, but after closing the app, I can open the correct zip file.

ok . . . One button to create the zip file and another to download it is a workable solution.

If moving the download to a separate event resolves the problem, it did so by some variable going out of scope. You could achieve the same thing in one button by setting that variable to NIL.

That’s ok … it’s working :slight_smile: