473,765 Members | 1,958 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Return image from webservice

Hi,

I have database with picture locations, for example: c:\temp\test.jp g.
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' />


Nov 8 '07 #1
2 7549
return strLocalPath.Re place( "file://c:\\temp\\", "http://images/" );

"zion" <zi***@msn.comw rote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
Hi,

I have database with picture locations, for example: c:\temp\test.jp g.
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' />




Nov 8 '07 #2
On Nov 8, 4:08 am, "zion" <zi...@msn.comw rote:
Hi,

I have database with picture locations, for example: c:\temp\test.jp g.
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\imag es\test.jpg" and the folder "c:\wwwpub\imag es"
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.

Nov 13 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4411
by: John Scott | last post by:
I am storing an image in an SQL database and have one field as an image datatype. I am also using a webservice to transport data. I want to be able to resize the image and pass back a thumbnail image in a byte of what is in the database. I also want to be able to display this image in an <asp:image></asp:image> control. Is there any way to do this? Most of the examples that I've seen have used
0
1145
by: Geert | last post by:
Hi all, I have a webservice that creates an image. I want to show the result of that image on my website. The website and webservice are on different servers. There is a VPN line between both servers. What is the best way to sent the image to my website? - save the file on a share - sent a stream from the webservice to the site (if it is possible to do) - save the file to http://websiteserver/tempfolder (if possible)
9
3220
by: MSDNAndi | last post by:
Hi, I have a set of simple webservices calls that worked fine using .NET Framework 1.0. I am calling a Java/Apache based webservices, the calling side is not able to supply a proper WSDL. What it does is to call a webservice with two parameters, one being a integer, the other one being a "String" which contains XML (not the best practice, however that is the target interface and we cannot change that).
2
2115
by: Nicolas | last post by:
Hello! I have a question: I have a database in MySql that has two fields (code and image). Now, I want to create a WebService that takes the image of the most current row (the code is the date in which the image took). And then, create a page in ASP.NET that calls this WebService, show the image and repeat this behavior every 5 seconds (it is the time that is take a new image be creating in the base of information). Can someone help or...
4
1764
by: Nicolas | last post by:
Hello! I have a question: I have a database in MySql that has two fields (code and image). Now, I want to create a WebService that takes the image of the most current row (the code is the date in which the image took). And then, create a page in ASP.NET that calls this WebService, show the image and repeat this behavior every 5 seconds (it is the time that is take a new image be creating in the base of information). Can someone help or...
5
2662
by: MattC | last post by:
Hi, I have a webservice that returns a byte for an image. I'd like to disaplay an image while the webservice is being contacted and then once the byte is available show that and remove the please wait image. I was thinking of trying to use the CallBack mechanism but wondered if AJAX would be better suited. I'd really just appreciate some ideas on how this could be acheived. I'll
3
6120
by: zion | last post by:
Hello, How can I return image link with webservice that I could see it in web page? The image is on my hard disk and <img src="c:\pictures\test.jpg" /does not work. If I use <img src=http://My comuter/Virtual directory/test.jpg /it's working but I can't use this because the image path is in DB with phisycal location. Thanks
4
7142
by: Jonathan | last post by:
I have a SQL stored procedure for adding a new record in a transactions table. It also has two return values: CounterID and IDKey. I want to create a webservice that accepts the 10 input parameters and returns the two return values. My C# programmer here says that webservice methods can only return 1 value per method. Is that right? Though I haven't ever created a webservice, I would have thought that a method could return a whole lot...
2
9789
by: ksheerasagar17 | last post by:
Hello All, Scenario: Sending an image through webservice as byte array to an Java webservice. The Problem1: The webservice method image property expects (data type) SByte rather than Byte array. Thus i'm converting a byte array to sbyte array and sending through web service. The converted SByte contains negative numbers wihch are resulting in an error "java.lang.ArrayIndexOutOfBoundsException: -106" Byte => SByte...error...
0
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9398
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10007
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9951
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9832
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5421
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3924
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3531
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.