在哪里保存/提取文件的Azure网站? [英] Where to save/extract files on Azure Web Sites?

查看:111
本文介绍了在哪里保存/提取文件的Azure网站?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对运行单元测试为我们的数据的Web应用程序,我想将其部署为Azure的网站。结果
问题是,在此应用程序的我下载相当大的zip文件,提取它们(50MB〜500里面的文件),并做一些测试,在这些文件。结果
我应该在哪里保存Azure网站这些大文件并在HOULD我解压呢?在本地主机上我一直在使用Path.GetTempPath(),但Azure的网站报道说有这个文件夹的空间,即使我的Azure网站拥有1000MB共有约990MB免费。结果
有什么办法如何使用这些1000MB为我的文件操作?结果
如果这是不可能的,我应该用在Azure Blob存储提取文件?

I have web application for running unit tests for our data and I want to deploy it as Azure Web Site.
The problem is in this app I'm downloading quite large zip files, extracting them (~50MB, 500 files inside) and doing some tests over these files.
Where should I save these large files on Azure Web Sites and where hould I extract them? On localhost I've been using "Path.GetTempPath()", but Azure Web Site is reporting that there is no space in this folder, even though my Azure Site has 1000MB total and about 990MB free.
Is there any way how to use these 1000MB for my file operations?
In case this is not possible, should I use the Azure Blob Storage for the extracted files?

推荐答案

在网站的情况下,当你的存储需求,适合withing提供本地存储的限制 - 你当然可以使用本地存储。

In case of Web Sites and when your storage requirements fit withing the constraints of provided local storage - you certainly can use local storage.

Path.GetTempPath()不是Azure的Web站点的最佳选择。我会说你应该把所有的文件,这是你的Web应用程序根目录,即使用Server.Mappath(〜/ tmp目录/)的一部分的文件夹中。请务必首先检查是否存在的文件夹,等在那里,你可以利用你拥有的存储空间。

However Path.GetTempPath() is not your best choice for Azure Web Site. I would say you shall put all the files in a folder which is part of your web app root folder, i.e. Server.MapPath("~/tmp/"). Make sure to first check for folder existence, etc. There you can utilize all the storage you have.

至于斑点 - 你必须单独解压缩每个文件并单独上传到一个blob。而当你有档案工作,必须重新下载。我不相信这是真正的解决方案,只要你有足够的本地存储,你可以利用。

As for Blob - you have to unzip each file separately and upload it separately to a blob. And when you have to work with the files, you have to download them again. I don't believe this is real solution, as long as you have enough local storage you can utilize.

这篇关于在哪里保存/提取文件的Azure网站?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆