Forums
This topic is locked
Download
Posted 04 Sep 2001 10:56:11
1
has voted
04 Sep 2001 10:56:11 Viktor Farcic posted:
When uploading files to my server I'm adding them random prefix to their file names. So, files are something like:{Qrjqu-fcoM6-fXVsH}-OriginalFileName.pdf
Does anybody knows how can I restore their original names upon downloading from server (OriginalFileName.pdf).
Replies
Replied 04 Sep 2001 18:53:57
04 Sep 2001 18:53:57 Joel Martinez replied:
hmm, I don't know how you do it now, but I think you'd have to use the filesystemobject to grab the file, then once you have to file, do something like this<pre id=code><font face=courier size=2 id=code>Response.AddHeader "Content-Disposition","attachment;filename=" _
& Right(strFileName, Len(strFileName) - InStrRev(strFileName, "}-")</font id=code></pre id=code>Of course, I didnt' test this code one bit, and I don't even know exactly how to grab a file and download it... just make sure to change the "response.contentType" property to whatever you're downloading.
try looking at the code made by Basic-Ultradev's Force Download SB (just search for it on the site) that may help you out also.
Joel Martinez [ ]
----------
set rs = conn.execute("SELECT answer FROM brain WHERE question = "& forumPost &"
'2nd place is just 1st Loser
E-Commerce Concepts with Ultradev...pre-order yours at
www.basic-ultradev.com/ecomm_concepts/
& Right(strFileName, Len(strFileName) - InStrRev(strFileName, "}-")</font id=code></pre id=code>Of course, I didnt' test this code one bit, and I don't even know exactly how to grab a file and download it... just make sure to change the "response.contentType" property to whatever you're downloading.
try looking at the code made by Basic-Ultradev's Force Download SB (just search for it on the site) that may help you out also.
Joel Martinez [ ]
----------
set rs = conn.execute("SELECT answer FROM brain WHERE question = "& forumPost &"
'2nd place is just 1st Loser
E-Commerce Concepts with Ultradev...pre-order yours at
www.basic-ultradev.com/ecomm_concepts/