English 中文(简体)
Windows Azure: Can t upload a 34 MB file on to the blob
原标题:

I was trying to upload a 34 MB file onto the blob but it is prompting me some error

    XML Parsing Error: no element found
Location: http://127.0.0.1:83/Default.aspx
Line Number 1, Column 1:

What should I do....How to solve it


I am able to upload small files of size 500KB.. but I have a file of size 34 MB to be uploaded into my blob container

I tried it using

protected void ButUpload_click(object sender, EventArgs e)
        {
            // store upladed file as a blob storage
            if (uplFileUpload.HasFile)
            {
                name = uplFileUpload.FileName;
                // get refernce to the cloud blob container
                CloudBlobContainer blobContainer = cloudBlobClient.GetContainerReference("documents");

                // set the name for the uploading files
                string UploadDocName = name;

                // get the blob reference and set the metadata properties
                CloudBlob blob = blobContainer.GetBlobReference(UploadDocName);
                blob.Metadata["FILETYPE"] = "text";
                blob.Properties.ContentType = uplFileUpload.PostedFile.ContentType;

                // upload the blob to the storage
                blob.UploadFromStream(uplFileUpload.FileContent);

            }
        } 

But I am not able to upload it.. Can anyone tell me How to do that....

最佳回答

Blobs larger than 64MB must be uploaded using block blobs. You break the file into blocks, upload all the blocks (associating each block with a unique string identifier), and at the very end you post the list of block IDs to the blob to commit the entire batch in one go.

Uploading in blocks is also recommended for large blobs less than 64MB in size. It is very easy for a hiccup in the network connection or routing through the internet to lose a frame or two in a very large upload, which will corrupt or invalidate the entire upload. Use smaller blocks to reduce your exposure to cosmic events.

More info in this discussion thread: http://social.msdn.microsoft.com/Forums/en-NZ/windowsazure/thread/f4575746-a695-40ff-9e49-ffe4c99b28c7

问题回答

I would start by dropping some logging into the project to try and track the problem down. It may not be happening where you think. There might also be a permissions error. Try adding some dummy data into the database. If it still fails that might be a potential problem.

But track it down yourself with some debug, logging and some code review, I bet you can get to the bottom of the problem sooner that way. And it will also help to make your code more robust.

You can use Blobs here. I think its an issue with your web request size. You can change this setting in the web.config by increasing the number of the maxRequestLength attribute in the element. If you are sending chunks of 500Kb, then you are wasting bandwidth and bringing down performance. Send bigger chunks of data such as 1-2 Mb per chunk. See my Silverlight or HTML5 based upload control for chunked uploads. Pick Your Azure File Upload Control: Silverlight and TPL or HTML5 and AJAX

Use the Blob Transfer Utility to download and upload all your blob files.

It s a tool to handle thousands of (small/large) blob transfers in a effective way.

Binaries and source code, here: http://bit.ly/blobtransfer





相关问题
Where does pg_lo_write store its contents?

There is a function in our system that writes a file to a postgres BLOB, the function is pg_lo_write, our system uses PHP, ADODB and PostgreSQL. What I would like to know is where is this data stored,...

How to embed a quicktime video from a MySQL Blob

I am currently pulling out images from a MySQL Blob using code as follows: <img src="data:<?php echo $type; ?>;base64,<?php echo base64_encode($file); ?>" width="240"/> I am now ...

Equivalent of SqLite Blob type in Subsonic?

In one SqLite table, I have a BLOB column for saving images (or binary data as a matter of fact). The table is Documents. Strangely, in Subsonic s ActiveRecord s Documents class, the type of that ...

How to display an Image from a mysql blob

I am trying to display an image from a MySQL blob field. I have tried a few different things and none of them seem to work. I have tried: header("Content-type: $type"); img src = $blobData; header("...

SQL 2008: Filestream versus Binaries in the database

Yesterday I asked the question on how I should save my files. After some research I ve desided to go with storing the files "in" the database. I ve checked the difference between storing the files ...

热门标签