Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: .NET3.5 .NET
Hi,

I am working on a silver light projrct.In this I need to upload an image and save it in a folder in the server(i.e., in a folder in the application). I want this funtion to be done on button click. So I cannot use file upload control. For getting the images I used open dialog. Now I have to sae the image.

If anyone have any idea to save the image to folder please reply me.


Thanks in advance.
Posted 7-Aug-09 19:38pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

If you are selecting a file by using OpenFileDialog then you will get the stream, right?

So, you can do http-post this stream to your web service.

Please check this example:

Silverlight File Upload[^]

Note: It's not possible to do without using any web service.

  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

You'll need to wire in a WCF service at the server side. The service would take the file information and byte array, then store it locally.

In your Silverlight application, you'll reference the service, then take your image data and send it.

To get to the image data, most likely you'll send it into a WriteableBitmap and then parse the Pixels array ... you can either format it on the Silverlight side and send it down, or send it raw and handle formatting on the server. Perhaps simple compression in the client, then uncompress and format into JPEG/PNG/etc on the server would be fine.

  Permalink  
  Print Answers RSS
0 CPallini 365
1 Sergey Alexandrovich Kryukov 262
2 OriginalGriff 165
3 George Jonsson 159
4 Richard MacCutchan 110
0 OriginalGriff 6,344
1 Sergey Alexandrovich Kryukov 5,860
2 CPallini 5,135
3 George Jonsson 3,559
4 Gihan Liyanage 2,522


Advertise | Privacy | Mobile
Web04 | 2.8.140916.1 | Last Updated 2 Dec 2009
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100