I am loading an image using
OpenFileDialog open = new OpenFileDialog();
After I select the file, "open" is populated with several items, including the path.
Now I would like to load the file into a filestream (or something similar) to be sent via a webservice... is this possible?
thanks
You can open the file with
FileStream
:You can then pass this through to the web service http context Response.OutputStream property. You will still need to set the correct mime type and various headers, but this works well:
Having said that, the easiest way to send a file from a web service (or web app) is to use the Response.WriteFile method:
try this:
Yes it is possible to create an image
or into a stream
But hot it should be send it is up to You to decide
sendToWs(img)