windows phone 7 - How To upload a Photo To Azure Blob with SAS from a WP App? -
i able upload photos blob sas azure mvc web role code below:
using (var ws = new hlserviceclient()) { /* getting sas write uri */ var sasuri = ws.getsasuriforblobwrite(hlservicereference.businesslogicmediausage.news, filename); var writeblob = new cloudblob(sasuri); writeblob.uploadfromstream(filedata.inputstream); } i same thing wp app. can't figure out how it. don't have lot of programming skill.
can tell me how upload photo blob wp app sas?
there windows azure storage client library windows phone available on nuget: phone.storage, says "class library windows phone communicate windows azure storage services directly", hoping find simple solution using that: http://www.nuget.org/packages/phone.storage
i found video tutorial on phone.storage nuget: http://channel9.msdn.com/posts/using-the-windows-phone-storage-nugets-for-windows-azure
there sample application demonstrating usage of phone.storage nuget. http://www.nuget.org/packages/phone.storage.sample
still, though, evades me if can implement in application scenario?
first, need generate sas hosted service. can use cloudblob.getsharedaccesssignature method (refer http://msdn.microsoft.com/en-us/library/windowsazure/ee772922.aspx sample).
on windows phone side, small files, need issue http request sas url. can use httpwebrequest that. try search web, , can find lot of samples, such http://blogs.msdn.com/b/devfish/archive/2011/04/07/httpwebrequest-fundamentals-windows-phone-services-consumption-part-2.aspx.
for large files (larget 64 mb), need divide them smaller pieces, upload each piece block, , commit blob list (put block list: http://msdn.microsoft.com/en-us/library/windowsazure/dd179467). tedious not difficult task. need create quite few http requests.
the windows azure toolkit windows phone may help: http://watwp.codeplex.com/. contains library similar windows azure library .net.
Comments
Post a Comment