Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > right clicking and saving pictures from my web site, i want to alow but not working.

Reply
Thread Tools

right clicking and saving pictures from my web site, i want to alow but not working.

 
 
James
Guest
Posts: n/a
 
      02-06-2004
when i right click and try to save a picture from my web site it some times
defaults the name and file type to 'unknown' bmp. the file is really a jpeg
that i am using the .binarywrite to display the image (so that im not
revailing my picture path to my users). the strange thing is some times it
will default as the correct file name and image type that i specified in the
..addheader method. any ideas why this some times works and some times
doesn't? just take the vb dll code at the bottom and make a active x dll in
vb and name the project ASPBinFile2 and the class clsASPBinFile.
more information at:
http://www.psacake.com/web/gj.asp
and
http://support.microsoft.com/default...NoWebContent=1

heres my asp code:
<%
FilePath = "d:\pictures\blah.jpg"
On Error Resume Next
If Not Response.isClientConnected Then
Response.end
End If
Response.buffer = true
'Specify a MIME type
Response.contenttype = "image/jpeg"
'Custom server component
Set objBinFile = Server.CreateObject("ASPBinFile.clsASPBinFile")
mStream = objBinFile.BinFileRead(FilePath)
Response.Addheader "Content-Disposition", "inline; filename=" & "blah.jpg"
Response.CacheControl = "public"
Response.binarywrite mstream
Set objBinFile = Nothing
Response.End

here is the vb active x dll that i created using vb6 (code was solen from
psacake.com i thought i better give credits.)

Option Explicit

Function BinFileRead(ByVal inFileSpec As String) As Variant
On Error GoTo errHandler
Dim mHandle
Dim lngFileLen As Long
Dim arrData() As Byte

mHandle = FreeFile
Open inFileSpec For Binary Access Read As #mHandle

lngFileLen = FileLen(inFileSpec)
ReDim arrData(lngFileLen)

Get #mHandle, , arrData
Close #mHandle

BinFileRead = arrData
Exit Function

errHandler:
End Function



--
http://www.velocityreviews.com/forums/(E-Mail Removed)


 
Reply With Quote
 
 
 
 
Ray at
Guest
Posts: n/a
 
      02-06-2004
It's quite possible that this is actually an IE issue and there's nothing
wrong with your code.

http://support.microsoft.com/?kbid=810978

Ray at work

"James" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> when i right click and try to save a picture from my web site it some

times
> defaults the name and file type to 'unknown' bmp. the file is really a

jpeg
> that i am using the .binarywrite to display the image (so that im not
> revailing my picture path to my users). the strange thing is some times it
> will default as the correct file name and image type that i specified in

the
> .addheader method. any ideas why this some times works and some times
> doesn't? just take t



 
Reply With Quote
 
 
 
 
Aaron Bertrand - MVP
Guest
Posts: n/a
 
      02-06-2004
I doubt this has anything to do with your code.

http://www.aspfaq.com/kbsearch.asp?q...ernet+explorer


--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/




"James" <(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
> when i right click and try to save a picture from my web site it some

times
> defaults the name and file type to 'unknown' bmp. the file is really a

jpeg
> that i am using the .binarywrite to display the image (so that im not
> revailing my picture path to my users). the strange thing is some times it
> will default as the correct file name and image type that i specified in

the
> .addheader method. any ideas why this some times works and some times
> doesn't? just take the vb dll code at the bottom and make a active x dll

in
> vb and name the project ASPBinFile2 and the class clsASPBinFile.
> more information at:
> http://www.psacake.com/web/gj.asp
> and
>

http://support.microsoft.com/default...NoWebContent=1
>
> heres my asp code:
> <%
> FilePath = "d:\pictures\blah.jpg"
> On Error Resume Next
> If Not Response.isClientConnected Then
> Response.end
> End If
> Response.buffer = true
> 'Specify a MIME type
> Response.contenttype = "image/jpeg"
> 'Custom server component
> Set objBinFile = Server.CreateObject("ASPBinFile.clsASPBinFile")
> mStream = objBinFile.BinFileRead(FilePath)
> Response.Addheader "Content-Disposition", "inline; filename=" & "blah.jpg"
> Response.CacheControl = "public"
> Response.binarywrite mstream
> Set objBinFile = Nothing
> Response.End
>
> here is the vb active x dll that i created using vb6 (code was solen from
> psacake.com i thought i better give credits.)
>
> Option Explicit
>
> Function BinFileRead(ByVal inFileSpec As String) As Variant
> On Error GoTo errHandler
> Dim mHandle
> Dim lngFileLen As Long
> Dim arrData() As Byte
>
> mHandle = FreeFile
> Open inFileSpec For Binary Access Read As #mHandle
>
> lngFileLen = FileLen(inFileSpec)
> ReDim arrData(lngFileLen)
>
> Get #mHandle, , arrData
> Close #mHandle
>
> BinFileRead = arrData
> Exit Function
>
> errHandler:
> End Function
>
>
>
> --
> (E-Mail Removed)
>
>



 
Reply With Quote
 
James
Guest
Posts: n/a
 
      02-06-2004
it happens on with this one issuse. all other pictures i save from the
internet work fine.

"Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
message news:(E-Mail Removed)...
> It's quite possible that this is actually an IE issue and there's nothing
> wrong with your code.
>
> http://support.microsoft.com/?kbid=810978
>
> Ray at work
>
> "James" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> > when i right click and try to save a picture from my web site it some

> times
> > defaults the name and file type to 'unknown' bmp. the file is really a

> jpeg
> > that i am using the .binarywrite to display the image (so that im not
> > revailing my picture path to my users). the strange thing is some times

it
> > will default as the correct file name and image type that i specified in

> the
> > .addheader method. any ideas why this some times works and some times
> > doesn't? just take t

>
>



 
Reply With Quote
 
Aaron Bertrand - MVP
Guest
Posts: n/a
 
      02-06-2004
> here is the vb active x dll that i created using vb6

Why do you think you need your own "vb active x dll"?

http://www.aspfaq.com/2161

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


 
Reply With Quote
 
James
Guest
Posts: n/a
 
      02-06-2004
i want to show them the picture, if they choose to download it they can. i
don't want to shove it down there throats thanks for the code tho im
playing with it maybe i can get it to show the image too.


"Aaron Bertrand - MVP" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> > here is the vb active x dll that i created using vb6

>
> Why do you think you need your own "vb active x dll"?
>
> http://www.aspfaq.com/2161
>
> --
> Aaron Bertrand
> SQL Server MVP
> http://www.aspfaq.com/
>
>



 
Reply With Quote
 
James
Guest
Posts: n/a
 
      02-06-2004
ok after following the directions of that site (which is a good idea) it
makes it display the image insted of automaticly opening it. but still it
does the same things with the name, it somes times displays Unknown and some
times displays the correct file name.


"James" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> i want to show them the picture, if they choose to download it they can. i
> don't want to shove it down there throats thanks for the code tho im
> playing with it maybe i can get it to show the image too.
>
>
> "Aaron Bertrand - MVP" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > > here is the vb active x dll that i created using vb6

> >
> > Why do you think you need your own "vb active x dll"?
> >
> > http://www.aspfaq.com/2161
> >
> > --
> > Aaron Bertrand
> > SQL Server MVP
> > http://www.aspfaq.com/
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Want to call jscript "confirm" box from VB.NET, but NOT from a but =?Utf-8?B?SlQ=?= ASP .Net 0 03-21-2006 12:14 AM
I want to create a link "e-mail this page to a friend" on clicking this link i want to send the URL of that current page to a friend pavi Javascript 0 01-13-2006 12:10 PM
Right-click context menu that can pass values when right-clicking a link?? Leon Javascript 3 11-26-2004 07:37 AM
I want to be able to access the internet by opening my browser and not right clicking and then clicking connect. James Johnson Computer Support 1 05-15-2004 03:40 AM
Protect Online Images from Hotlinking and Right-clicking - Request For Help Ted Stresen-Reuter Digital Photography 62 04-24-2004 12:30 AM



Advertisments