Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Download with Image Name

Status
Not open for further replies.

livezone

MIS
Jan 17, 2003
81
CA
Hi,

On my aspx page (MyPage.aspx), I am issuing the following commnad

Response.Redirect(ImgURL) ' Where ImgURL is the Absolute Path of the Image

On the image page, if I right click on the image to save it it will try to save it with MyPage.aspx instead of the Image name.

How can I force him to show the image name in the save dialog box?

Thanks
Shafiq
 
thats strange, it worked for me though in IE it asked me to save it as BMP (which sometimes happens).

can i have an example imageURL...

Known is handfull, Unknown is worldfull
 
This is strange, I used IE also, and it puts in the page name(instead of the image name) with an extention of .htm

????????????


Jim
 
and that didnt ask me to save in html, it asked me to save as BMP(which is a bug that occurs sometimes with images in IE)...

Known is handfull, Unknown is worldfull
 
It defaulted to .jpg in the file type box, but the file name defaulted to the page name. I assumed like livezone, that the image name would be in the box by default.
 
Here is the code

Sub DownloadImage(ByVal sender As Object, ByVal e As CommandEventArgs)

Dim ImgURL As String

If e.CommandName = "Download" Then
ImgURL = e.CommandArgument
Response.Redirect(ImgURL)
End If
End Sub

I assign the imgURL dynamically using this code as my image path is stored in a database (absolute path) like

If Not IsDBNull(dtr("ReferenceImageUrl")) Then
imgProduct.ImageUrl = dtr("ReferenceImageUrl")
imgProduct.ImageAlign = ImageAlign.AbsMiddle
imgProduct.ToolTip = dtr("ProductDescription")
imgbDownLoad.CommandArgument = dtr("ReferenceImageUrl") End If

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top