Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Images are not getting displayed when using HTTPHandler

Reply
Thread Tools

Images are not getting displayed when using HTTPHandler

 
 
=?Utf-8?B?SGl0ZXNo?=
Guest
Posts: n/a
 
      04-22-2005
Hi,

I am getting the response from another Website by using the HttpHandler in
my current site. I am getting the page but all the images on that page are
not appearing only placeholder are displayed.

Can anybody know this issue and help me to resolve this.
--
Thanks
Hitesh
 
Reply With Quote
 
 
 
 
Brock Allen
Guest
Posts: n/a
 
      04-22-2005
Open the rendered HTML, look for the <img> tags and it should be obvious.
<img> tags require another request to the server to fetch the image at the
URL specified in the src attribute. So in your handler, you'll need to parse
the HTML you're getting back, find the <img> tags, make another request to
get those, change the src rendered from your handler to come back into you,
then dynamically serve up the bits of those images. This assumes the images
aren't available at the original URLs, but it doesn't sound like they are.

-Brock
DevelopMentor
http://staff.develop.com/ballen



> Hi,
>
> I am getting the response from another Website by using the
> HttpHandler in my current site. I am getting the page but all the
> images on that page are not appearing only placeholder are displayed.
>
> Can anybody know this issue and help me to resolve this.
>




 
Reply With Quote
 
 
 
 
=?Utf-8?B?SGl0ZXNo?=
Guest
Posts: n/a
 
      04-25-2005
Hi Brock,

Thanks for your suggestion and i have done the task in one more way let me
discuss that with you and confirm that it will work always:

See what i have done is while parsing the response i have replaced the src
attribute of all the img tags by appending the "http:// + remote host name"
to them and now its rendering the image also.

So what do you think is this ok or it has some drawbacks in it ?

and if you find anything wrong with it then it would be very helpful if you
can give me some sample code of your approach, i am really wondering how
should i write the code to get the images only once again and merge the two
responses together?

Thanks!

"Brock Allen" wrote:

> Open the rendered HTML, look for the <img> tags and it should be obvious.
> <img> tags require another request to the server to fetch the image at the
> URL specified in the src attribute. So in your handler, you'll need to parse
> the HTML you're getting back, find the <img> tags, make another request to
> get those, change the src rendered from your handler to come back into you,
> then dynamically serve up the bits of those images. This assumes the images
> aren't available at the original URLs, but it doesn't sound like they are.
>
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
>
> > Hi,
> >
> > I am getting the response from another Website by using the
> > HttpHandler in my current site. I am getting the page but all the
> > images on that page are not appearing only placeholder are displayed.
> >
> > Can anybody know this issue and help me to resolve this.
> >

>
>
>
>

 
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
HttpHandler not getting called Joe Reiss ASP .Net 3 06-06-2007 06:32 PM
Japanese Text not displayed on Image Generated by Servlet on winXP, Linux but displayed on Win2000 boney Java 1 12-15-2006 02:24 PM
Images not getting rendered when using httphandler =?Utf-8?B?SGl0ZXNo?= ASP .Net 3 05-13-2005 07:14 AM
Getting access denied error on using HTTPHandler Hitesh ASP .Net Security 0 04-13-2005 06:29 AM
Re: HttpHandler for images and browser behavior David J. Berman ASP .Net 0 06-24-2003 02:26 PM



Advertisments