Looks like you need to use the stream version:
// This will override anything that already exists,using (FileStream fs = new FileStream(filename, FileMode.Create))
{// I'm using a one-hour timeoutfileBlob.DownloadToStream(fs, new BlobRequestOptions() { Timeout = new TimeSpan(1, 0, 0)});}
This guy also had the same problem http://social.msdn.microsoft.com/Forums/en-US/windowsazure/thread/649ee4a0-8d38-4cd7-aba5-1c34cd033865
Update: I did a bit of testing with the Timeout BlobRequestOptions and the TimeSpan you set is more of a guideline.. ;) I set the timeout to be 1 second and it took about 10 seconds to actually timeout. I'm guessing that they stream a certain amount (I think it was 4096kb) then check if the timeout has passed, then read a bit more if it hasn't. In any case, it's working now.
Update 2: Stupidly I wasn't closing the file stream which caused the file to be cut short! argh! Anyway, wrap it in a "using" like usual to call the Close().
No comments:
Post a Comment