Advertisement

06.06.2008 at 02:45PM PDT, ID: 23465178 | Points: 500
[x]
Attachment Details

How to specify destination folder on file download in asp pages

Asked by beef137 in Active Server Pages (ASP), VB Database Programming, VB Script

Tags: Microsoft / old ASP pages, Visiual Stidio 6/ vb asp, 6, vbscript/old asp pages/ html/ java script, IE & firefox

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").ActualSize
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("ValueOfSetting").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 = sScriptTimeoutStoredStart Free Trial
 
Loading Advertisement...
 
[+][-]06.06.2008 at 05:15PM PDT, ID: 21733619

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.26.2008 at 12:36PM PDT, ID: 21878225

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628