Windows 8.1 BackgroundUploader with Amazon S3 c# in XAML -


trying upload files windows 8.1 amazon s3 in background. kindly suggest how can proceed. using xaml. code snippet of backgrounddownloader , backgrounduploader amazon s3 great help. please find partial implementation of below.

 public async task uploadfile(ireadonlylist<storagefile> files)     {         basicawscredentials = new basicawscredentials(accesskey,secretkey);         list<backgroundtransfercontentpart> parts = new list<backgroundtransfercontentpart>();         (int = 0; < files.count; i++)         {             backgroundtransfercontentpart part = new backgroundtransfercontentpart("file" + i, files[i].name);             part.setfile(files[i]);             parts.add(part);         }         uri uri = new uri(bucketurl+existingbucketname+"/");         backgrounduploader uploader = new backgrounduploader();         uploadoperation upload = await uploader.createuploadasync(uri, parts);         // attach progress , completion handlers.         await handleuploadasync(upload, true);     }     private async task handleuploadasync(uploadoperation upload, bool start)     {         try         {             cancellationtokensource cts = new cancellationtokensource();             progress<uploadoperation> progresscallback = new progress<uploadoperation>();             if (start)             {                 // start upload , attach progress handler.                 await upload.startasync().astask(cts.token, progresscallback);             }             else             {                 // upload running when application started, re-attach progress handler.                 await upload.attachasync().astask(cts.token, progresscallback);             }              responseinformation response = upload.getresponseinformation();             //  log(string.format("completed: {0}, status code: {1}", upload.guid, response.statuscode));         }         catch (taskcanceledexception)         {             // log("upload cancelled.");         }         catch (exception ex)         {             //logexception("error", ex);         }     } 


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -