NetTalk Central

Author Topic: File Download - does file need to be in same folder as web server EXE?  (Read 3131 times)

Mike McLoughlin

  • Full Member
  • ***
  • Posts: 126
    • View Profile
    • Clarion Templates
    • Email
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

Mike McLoughlin

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
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