File upload and download on Azure
Someone asked on Stack Overflow:
I want have my azure . NET web application upload a file, manipulate it and then download the changed version.
Should I use blob storage? I don’t actually need to store the data in the file.
Should I use blob storage?
That depends on what your requirements are.
I don’t actually need to store the data in the file.
Given this fact, you probably don’t need to use blog storage.
You could simply do something like this:
var postedFile = Request.Files[0] as HttpPostedFileBase;
var stream = new MemoryStream();
postedFile.InputStream.CopyTo(stream);
// work with MemoryStream
...
//return your file which could be different based on mvc, web forms or whatever
Originally posted on Stack Overflow — 1 upvotes (accepted answer). Licensed under CC BY-SA.