1

I make a client program. It gets it data from local database and i create a Webservice which updates data from server to client database.

My question is about how can I send Image(jpg) files from server to client. Can I help do it with webservice.

P.S Database Only saves image file path. I must send files from server to client.

My client program and webservice written in C# (MS visual Studio)

Database is MS SQl server 2008 Client database is MS Compact Edition

5
  • where is the code ? write something , if there are errors post them !!! Dec 1, 2011 at 14:53
  • There is no code for sending image.I want to know how i can do it? Dec 1, 2011 at 14:53
  • You you say client, do you mean web browser? Dec 1, 2011 at 14:54
  • No , client program written in C# WPF appication which uses SQL Compact edition. Dec 1, 2011 at 14:55
  • There are many tutorials how to download file using webservice. Here is one of them.
    – Renatas M.
    Dec 1, 2011 at 14:56

1 Answer 1

3

yes you can load the image up into a byte array and send that through the web method. The webmethod just has to have a return type of byte[]

it might be even easier though to skip the webservice for the image though and load it directly from at site - so have a website that is pointed at your image directory. Create a url that references that image - and return that. The client can then do a web request to get that and display it / what whatever it is going to do?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.