开发者

Upload Photos using Silverlight - Ria Services

开发者 https://www.devze.com 2023-01-09 09:03 出处:网络
i\'m trying to find a good exemple on uploading and downloading images using solely Silverlgith + Ria Services, i tried to find some b开发者_JAVA百科ut i failed, please any help would be appreciated.

i'm trying to find a good exemple on uploading and downloading images using solely Silverlgith + Ria Services, i tried to find some b开发者_JAVA百科ut i failed, please any help would be appreciated.

thank you all in advance


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


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)
0

精彩评论

暂无评论...
验证码 换一张
取 消