开发者

Uploading a large file(2GB Max) On Windows Azure Webrole Using SWFUploader

开发者 https://www.devze.com 2023-02-02 13:01 出处:网络
I have an application, in that I want to upload a large file max up to 2GB, and after processing this file I want to store it as blob on blobstorage. I am using SWFUploader to upload the files (I want

I have an application, in that I want to upload a large file max up to 2GB, and after processing this file I want to store it as blob on blobstorage. I am using SWFUploader to upload the files (I want to show progress bar, which is must).

The problem is, I am unable to upload a file more than 100 MB. After uploading a file up to 100 MB (or sometimes 90-95 MB) it restarts the whole uploading process and sometimes it just fails. I am using a Webrole project, for this entire task.

So my question is: Can I upload such large file on windows azure webrole project (basically its Asp.net website, so i want to upload a file on webserver) and process it over there and then upload it to blobstorage?

According to my knowledge I did following things:

1: I have set following parameters in web.config

<security>
<requestFiltering>
 <!--maxAllowedContentLength in bytes-->
        <requestLimits maxAllowedContentLength="2147483648"></requestLimits>
</requestFiltering>
</security>

<httpRuntime executionTimeout="999999" maxRequestLength="2097152"/>

2: I have changed default TMP/TEMP folder of ASP.Net(which is 100 MB by default) to new folder that i have created in local storage resuorces by using follwiing code snippet

I have created this "CustomTempLocalStore" as

<LocalStorage name="CustomTempLocalStore" cleanOnRoleRecycle="false" sizeInMB="1024" />

then set this local storage resources to use as TMP/TEMP by setting following code in onstart() menthod of webrole.

string customTempLocalResourcePath = RoleEnvironment.GetLocalResource("CustomTempLocalStore").RootPath;
Environment.SetEnvironmentVariable("TMP", customTempLocalResourcePath);
Environment.SetEnvironmentVariable("TEMP", cus开发者_如何学JAVAtomTempLocalResourcePath);

I found this on follwing link: http://msdn.microsoft.com/en-us/library/dd573354.aspx

Still its not working, the SWFUploader is giving follwing error:

Server(IO)Error

Any ideas?


By default, local storage on Windows Azure is limited to 100MB. At least it was at the time of this blog post, which explains in detail how to work around it.


You can use Azure Blobs shared signature to allow the client write directly on the blob:

http://convective.wordpress.com/2010/01/20/access-control-for-azure-blobs/

Cheers.


Here is an MSDN article explaining the 100 MB TEMP folder limit, and giving a simple workaround, which involves redirecting the TEMP directory (different to Dave's answer).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号