NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Mike McLoughlin on July 01, 2009, 07:58:33 AM

Title: File Download - does file need to be in same folder as web server EXE?
Post by: Mike McLoughlin on July 01, 2009, 07:58:33 AM
Working on example 40 I have set up an Other button to call ServeDocument with a file name.

The prompt save/run comes up OK but the file option to save to includes the mangled path:

If I pass it '.\web\downloads\yosemite_prayers.wav' it shows this in the save to dialog

._web_downloads_yosemite_prayers.wav

If I don't pass the path with the file it doesn't find the file.  So I need a way to take out the '._web_downloads_'

In the example I notice the files are in the exe folder.

regards

Mike

Title: Re: File Download - does file need to be in same folder as web server EXE?
Post by: Bruce on July 03, 2009, 07:42:29 AM
no the file doesn't have to be in the exe folder, it can be anywhere on the disk that you allow.

the file served is stored in loc:filename in the ServeDocument procedure.

however the name sent back to the browser is set in the content disposition. ie

p_web.HeaderDetails.ContentDisposition = 'attachment; filename="'&clip(loc:fileName)&'"'

in the example it uses loc:filename there, but you can use anything, literally anything, you like.

Cheers
Bruce