Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
280 views
in Technique[技术] by (71.8m points)

c# - Where to save/extract files on Azure Web Sites?

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

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.

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...