Return image from webservice

  • Thread starter Thread starter zion
  • Start date Start date
Z

zion

Hi,

I have database with picture locations, for example: c:\temp\test.jpg.
How can webservice return picture link?
<img width=200 height=150 src='file://c:\\temp\\test.jpg' />

<img width=200 height=150 src='c:\\temp\\test.jpg' />

It works only if the link is:

<img width=200 height=150 src=http://images/test.jpg' />
 
Hi,

I have database with picture locations, for example: c:\temp\test.jpg.
How can webservice return picture link?
<img width=200 height=150 src='file://c:\\temp\\test.jpg' />

<img width=200 height=150 src='c:\\temp\\test.jpg' />

It works only if the link is:

<img width=200 height=150 src=http://images/test.jpg'/>

Hi, the image on server can be seen on client (browser) if that
image's located in a virtual directory. For example, you have an image
in "c:\wwwpub\images\test.jpg" and the folder "c:\wwwpub\images"
mapped to virtual directory "/pub/". So this image can be request at
url "http://host/pub/test.jpg"
In your case, you have two ways to solve :
1. Change image localtion in your database to some folder mapped to
virtual directory
2. Store image content instead path. In this way, you just return
image content (as binary stream) with some http header to tell browser
know that image.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top