NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: broche on March 23, 2014, 01:55:00 PM
-
Hi all,
Nettalk 8, Clarion 8, Win 7
Firefox
Downloading file successfully except the name of the file when it hits the browser on the client side puts the directory I got it from on ths start of the filename.
Example: File name is brian.doc
When the file is downloaded it becomes c_templateBrian.doc
C:\Template is where I got it from on the server. See code below:
loc:filename = p_web.GSV('TemplateDir') & '\' & p_web.GetValue('name')
p_web.HeaderDetails.ContentDisposition = 'attachment; filename="'&loc:filename &'"'
Not sure what I am doing wrong?
Brian.
-
Hi Brian,
I suppose the question becomes;
what are the contents of p_web.GSV('TemplateDir') and p_web.GetValue('name')
and hence what is in loc:filename after
loc:filename = p_web.GSV('TemplateDir') & '\' & p_web.GetValue('name')
Cheers
Bruce
-
Thanks Bruce,
TemplateDir is the location the blob is extracted to on the server
name is the exact name of the file eg brian.doc being passed by the servedocument routine when the doc is clicked for download.
So I see that that is what it is being named I suppose I don't understand how the code is getting the file?
I thought loc:filename had to contain the full path in order for that line to knoiw where the file is being pulled from?
Brian
-
No, it's the opposite. Content disposition suggests a save-as name to the browser. Don't include a path there.
-
Thanks that worked - Sorry but I still don't understand how it is getting the file I want.
The file is in C:\Templates
Not in the web directory, so how does it know this?
from:
loc:filename = p_web.GSV('TemplateDir') & '\' & p_web.GetValue('name')
loc:brname = p_web.GetValue('name')
p_web.HeaderDetails.ContentDisposition = 'attachment; filename="'&loc:brname &'"'
Thanks