Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/319.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Azure上的文件上载和下载_C#_Azure - Fatal编程技术网

C# Azure上的文件上载和下载

C# Azure上的文件上载和下载,c#,azure,C#,Azure,我想要我的蓝色。NET web应用程序上载文件,对其进行操作,然后下载更改的版本 我应该使用blob存储吗?我实际上不需要将数据存储在文件中 我应该使用blob存储吗 这取决于你的要求是什么 我实际上不需要将数据存储在文件中 鉴于这一事实,您可能不需要使用博客存储 您可以简单地执行以下操作: var postedFile = Request.Files[0] as HttpPostedFileBase; var stream = new MemoryStream(); postedFile.In

我想要我的蓝色。NET web应用程序上载文件,对其进行操作,然后下载更改的版本

我应该使用blob存储吗?我实际上不需要将数据存储在文件中

我应该使用blob存储吗

这取决于你的要求是什么

我实际上不需要将数据存储在文件中

鉴于这一事实,您可能不需要使用博客存储

您可以简单地执行以下操作:

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
Blob存储(就像任何其他存储一样)是在您确实需要存储数据时使用的,如果您不需要存储数据并且能够动态地(可能是从内存流)操作数据,那么就不要存储它。