none
Azure Blob Storage MVC smaple

    Pertanyaan

  • I was following along with this sample project sample article and in the code to upload the blob which in my case was a simple text file I get this error :

    "ReadTimeout = 'fileStream.ReadTimeout' threw an exception of type 'System.InvalidOperationException'"

    in this code:

    private CloudBlobContainer GetCloudBlobContainer()
             {
                CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
                        CloudConfigurationManager.GetSetting("clownp_AzureStorageConnectionString"));
                CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
                CloudBlobContainer container = blobClient.GetContainerReference("test-blob-container");
                return container;
            }
    public string UploadBlob()
            {
               
                CloudBlobContainer container = GetCloudBlobContainer();
                CloudBlockBlob blob = container.GetBlockBlobReference("myBlob");
                using (var fileStream = System.IO.File.OpenRead(@"c:\Test\sample.txt"))
                {
                    blob.UploadFromStream(fileStream);
                }
                return "success!";
            }
    
    I'm not sure how to narrow down the problem here.  Can someone assist me in direction to take? 

    Kamis, 02 Agustus 2018 22.36

Semua Balasan

  • Hi Mimosa Arts,

    This forum discusses and asks questions about the C# programming language, since your issue is more related to asp.net MVC, I would suggest that you could post your issue on asp.net MVC forum for suitable support.

    https://forums.asp.net/1146.aspx/1?MVC

    Thanks for your understanding and cooperation.

    Best regards,

    Zhanglong


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Jumat, 03 Agustus 2018 02.21