How can I to Upload a file with C# ? I need to upload a file from a dialogWindow.
See Question&Answers more detail:osHow can I to Upload a file with C# ? I need to upload a file from a dialogWindow.
See Question&Answers more detail:osusing Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Auth;
using Microsoft.WindowsAzure.Storage.Blob;
// Retrieve storage account from connection string.
CloudStorageAccount storageAccount = CloudStorageAccount.Parse("StorageKey");
// Create the blob client.
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
// Retrieve reference to a previously created container.
CloudBlobContainer container = blobClient.GetContainerReference("mycontainer");
// Retrieve reference to a blob named "myblob".
CloudBlockBlob blockBlob = container.GetBlockBlobReference("myblob");
// Create or overwrite the "myblob" blob with contents from a local file.
using (var fileStream = System.IO.File.OpenRead(@"pathmyfile"))
{
blockBlob.UploadFromStream(fileStream);
}
see here about needed SDK and references
i think it's what you need