Downloading File through ASP.
-
If I have a database that has a whole lot of files in it that are incoded in BASE64. Is there some way I can return them straight to HTML so the browser knows to it is downloading a file....e.g. I want to return the BLOB so that I am really returning an HTML page to the person will see www.xyz.com/download.asp and download.asp contains something like Content-Type: application/octet-stream; name="test.exe" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="test.exe" qANQR1DBwA4DXCexCm8KkTsQAv9wDCPX+7o05gnUq0hH5nEPofQ5a8bpnx82OqvmgKCd65fBIbz9 8GjkmslBrB9N+LU7G0RMbhIZFYHcoqOMW1Jje64UR/6TLQ/61Fw+v/j0bsPXU8/ACdb0tX9kNjR8 C/0C/0k7nBcylnZmMHrYXeuGfjAnLjyXMu08+wCCCf0IYn6COEZObwCXlESgOXfIITMq44QJno91 w4enDZ5t0X9KewUrcVh8hUq4WKsXGPRI0DV5YlJEuNAImlf+DvL4DrtI9cHCTgPZ0XOtEPSlchAM AKIJh+R2vswfQheAla7fkLp1hqShCra1DkXTdU41EHfwf9EVmOs2d9ovLuFWnH8ukqh8BYNjXuxK Rfo13mMXqRQBW5b0pKcVPONOcokD2mDaKiuYIbmwm6A+I9LUfAoxg9tj6IrF1LxL53Ysq3FMxqh0 OJKg5iYpBqnhCVgUon6p/Fn41onF9HVhbxZsdRTpIum9YjctoMGNb3DTclp9tX/cEFIGvhuOTZUR 6401S= and then the browser will know to pop-up a download dialog.
-
If I have a database that has a whole lot of files in it that are incoded in BASE64. Is there some way I can return them straight to HTML so the browser knows to it is downloading a file....e.g. I want to return the BLOB so that I am really returning an HTML page to the person will see www.xyz.com/download.asp and download.asp contains something like Content-Type: application/octet-stream; name="test.exe" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="test.exe" qANQR1DBwA4DXCexCm8KkTsQAv9wDCPX+7o05gnUq0hH5nEPofQ5a8bpnx82OqvmgKCd65fBIbz9 8GjkmslBrB9N+LU7G0RMbhIZFYHcoqOMW1Jje64UR/6TLQ/61Fw+v/j0bsPXU8/ACdb0tX9kNjR8 C/0C/0k7nBcylnZmMHrYXeuGfjAnLjyXMu08+wCCCf0IYn6COEZObwCXlESgOXfIITMq44QJno91 w4enDZ5t0X9KewUrcVh8hUq4WKsXGPRI0DV5YlJEuNAImlf+DvL4DrtI9cHCTgPZ0XOtEPSlchAM AKIJh+R2vswfQheAla7fkLp1hqShCra1DkXTdU41EHfwf9EVmOs2d9ovLuFWnH8ukqh8BYNjXuxK Rfo13mMXqRQBW5b0pKcVPONOcokD2mDaKiuYIbmwm6A+I9LUfAoxg9tj6IrF1LxL53Ysq3FMxqh0 OJKg5iYpBqnhCVgUon6p/Fn41onF9HVhbxZsdRTpIum9YjctoMGNb3DTclp9tX/cEFIGvhuOTZUR 6401S= and then the browser will know to pop-up a download dialog.
Personally, I haven't come across such an issue as yours, but I found the following ASP/Vbscript sample code in MSDN.. Response.ContentType = “image/gif” Set cnnPubs = Server.CreateObject(“ADODB.Connection”) cnnPubs.Open “pubs”, “sa” Set rstPub_Info = cnnPubs.Execute(“SELECT logo FROM pub_info WHERE _ pub_id=’1389'”) Response.BinaryWrite rstPub_Info(“logo”) Response.End The idea is to stream out the blob contents to the browser. The example above is probably just a trivial one. Please follow up to “Delivering Web Images from SQL Server,” by Scott Stanfield (MIND, July 1998) for more info. MIND is at www.microsoft.com/mind. Check out "Top Ten Tips Accessing SQL Through ADO and ASP" By J.D. Meier in MSDN. Hope that helps.. regards Arup
-
Personally, I haven't come across such an issue as yours, but I found the following ASP/Vbscript sample code in MSDN.. Response.ContentType = “image/gif” Set cnnPubs = Server.CreateObject(“ADODB.Connection”) cnnPubs.Open “pubs”, “sa” Set rstPub_Info = cnnPubs.Execute(“SELECT logo FROM pub_info WHERE _ pub_id=’1389'”) Response.BinaryWrite rstPub_Info(“logo”) Response.End The idea is to stream out the blob contents to the browser. The example above is probably just a trivial one. Please follow up to “Delivering Web Images from SQL Server,” by Scott Stanfield (MIND, July 1998) for more info. MIND is at www.microsoft.com/mind. Check out "Top Ten Tips Accessing SQL Through ADO and ASP" By J.D. Meier in MSDN. Hope that helps.. regards Arup