Patzo
Patzo

Reputation: 31

Upload Photos using Silverlight - Ria Services

i'm trying to find a good exemple on uploading and downloading images using solely Silverlgith + Ria Services, i tried to find some but i failed, please any help would be appreciated.

thank you all in advance

Upvotes: 3

Views: 1288

Answers (2)

GarethOwen
GarethOwen

Reputation: 6133

We did it by saving the images on disk (not in a DB) - like this:

Upload image:

  • Write a Domain Service with an operation like void UploadJPGImage(string uniqueName, byte[] jpgBytes). This needs to be marked with the attribute for ClientAccess. The (server-side) implementation saves the image on the disk.
  • for the uniqueName, we generate a GUID client-side

Download image:

  • HTTP Handler - write an HTTP handler for downloading the image using a URL containing the unique name parameter passed by the client when uploading the image
  • Or, one could write a Domain Service operation, like byte[] DownloadJPGImage(string uniqueName)

Upvotes: 1

Synxmax
Synxmax

Reputation: 2224

I just found some useful walk trough here and make sure to read follow-up that improves the save process and used image

Upvotes: 1

Related Questions