Signup · Login
Stardeveloper.com  
Home · Tutorials · Forums · ASP.NET Newsletter Application · Web Hosting Plans · Faisal Khan's Blog · Contact
Forums : ASP : ADO/ODBC : Response.BinaryWrite PROBLEM !!?? Signup · Login
Author Thread
Response.BinaryWrite PROBLEM !!??
Posted in tutorial: Displaying Images from an Access Database using plain ASP
·  momoaal
User
Joined: 30 Dec 2004
Total Posts: 2

Response.BinaryWrite PROBLEM !!??

Posted: 30 Dec 2004
when using "Response.BinaryWrite rs("File Data")"
when i click on the file or "save target as " , the browser show the save as dialog , and the file name as "File.asp" ??

how to change the file name of the file being saved ???
i don't want to change the file name everytime i save it ?
i just want to save it with it's "Original" file name !!

anybody knows how to do this ??

thanks !
·  l33tG33k
User
Joined: 3 May 2006
Total Posts: 1
Re: Response.BinaryWrite PROBLEM !!??
Posted: 3 May 2006
All you need to do is add the following line before you do the binary write:
Response.AppendHeader("Content-Disposition",
"attachment; filename=[TheFileNameYouWant.jpg]");
Replace [TheFileNameYouWant.jpg] with anything you want to appear in the save as dialog.

I only require 2 things, a pc and pizza :)
Want to leave a comment? Login or Register for free!

Users Who Have Visited This Thread In Last 24 Hours
3 Visitors

Login to post a comment or start a new thread
UserName Or Email Address:       Password:       Auto-Login:    
· Create New User Account
· Send Forgotten Password by Email
 
© 1999 - 2010 Stardeveloper.com, All Rights Reserved.