I have a code that I use for users to download files from a website. It is built on the old Asp pages. I can't specify the destination folder when they click on the download. So my question, is there a way I can incorporate some kind of download that takes them to a default folder?
The file is stored in a binary format in SQL database. The problem is that I get to the "file Download" screen, and then when they click save it opens the Save Dialog screen that allow them to specify location. I would like the Save Dialog screen to be set on an automatic or default location. How do you do that?
This is the segment of the code that I need help with:
'/************************
**********
**********
**********
**********
**********
**********
**********
**********
**********
**/
Response.AddHeader "content-disposition", "attachment; filename=" & rsData("FileName").Value
Response.AddHeader "content-length", rsData("BinFile").ActualSi
ze
Response.ContentType = "application/octet-stream"
Response.AddHeader "AutomatedResult", "200 Download Successful"
Dim sScriptTimeoutStored, sWebtimeout, rsWebTimeout
sScriptTimeoutStored = Server.ScriptTimeout
sWebtimeout = "Select ValueOfSetting from WebSiteSettings Where NameOfSetting = 'DownloadScriptTimeOut' "
Set rsWebTimeout = Server.CreateObject("ADODB
.Recordset
")
rsWebTimeout.Open sWebtimeout, oConn_Data, adOpenKeyset, adlockreadonly
Server.ScriptTimeout = rsWebTimeout("ValueOfSetti
ng").Value
' Write the file
Dim ChunkSize
dim LeftToWrite
ChunkSize = 1024 * 1024
LeftToWrite = 0 + rsData("FileSize")
do while LeftToWrite > 0
if ChunkSize >= LeftToWrite then
ChunkSize = LeftToWrite
end if
Response.BinaryWrite rsData("BinFile").GetChunk
(ChunkSize
)
LeftToWrite = LeftToWrite - ChunkSize
loop
Server.ScriptTimeout = sScriptTimeoutStored
Start Free Trial