Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As corvus stated, you are writing to "local storage" which is volatile and not shared across multiple instances of your virtual machine.</p> <p>Blob storage lets you store arbitrary files, images, etc. Each item gets stored in its own blob. You also have the notion of a "container" - think of it as a top-level directory folder. There are no nested containers, but you can emulate them with path characters in the name (skip this for now, as you need a quick solution).</p> <p>If you download the <a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;id=8396" rel="nofollow">Windows Azure Platform Training Kit</a> and look at the lab "Introduction to Cloud Services", it shows a Guestbook application, where photos are uploaded to blob storage. You will see how to set up a storage account, as well as writing the code to push your file to a blob instead of the local file system. Here's a snippet from the sample:</p> <p>Initialize blob client, and set up container to store your files:</p> <pre><code>var storageAccount = CloudStorageAccount.FromConfigurationSetting("DataConnectionString"); // create blob container for images blobStorage = storageAccount.CreateCloudBlobClient(); CloudBlobContainer container = blobStorage.GetContainerReference("uploads"); container.CreateIfNotExist(); </code></pre> <p>Now, in your upload handler, you'd write to a blob instead of local file system:</p> <pre><code> string uniqueBlobName = string.Format("uploads/image_{0}{1}", Guid.NewGuid(), Path.GetExtension(UserImg.FileName)); CloudBlockBlob blob = blobStorage.GetBlockBlobReference(uniqueBlobName); blob.Properties.ContentType = UserImg.PostedFile.ContentType; // note: there are several blob upload methods - // choose the best one that fits your app blob.UploadFromStream(UserImg.FileContent); </code></pre> <p>You'll see the full working sample once you download the Platform Training Kit.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload