0

I'm trying to upload image to azure blob storage from my windows phone 8. I'm using CameraCaptureTask and the codes below work fine for me to upload image into azure storage. But, is there any way to upload multiple images at once?

    private void save_Click(object sender, RoutedEventArgs e)
    {
        UploadToAzureBlobStorage(imageStream);
    }

    private void capture_Click(object sender, RoutedEventArgs e)
    {
        cam.Show();
    }

    void cam_Completed(object sender, PhotoResult e)
    {
        if (e.TaskResult == TaskResult.OK)
        {
            BitmapImage bmp = new BitmapImage();
            bmp.SetSource(e.ChosenPhoto);

            imagestream = e.ChosenPhoto;
        }
    }

    private void UploadToAzureBlobStorage(Stream stream)
    {
        var blobClient = CloudStorageContext.Current.Resolver.CreateCloudBlobClient();
        var container = blobClient.GetContainerReference("images");

        container.CreateIfNotExist(
            BlobContainerPublicAccessType.Container,
            response =>
            {
                var blob = container.GetBlobReference("image.jpg");

                blob.UploadFromStream(
                    stream,
                    response2 =>
                    {
                        MessageBox.Show("Upload complete.");
                    });
            });
    }
  • Could be a possible duplicate of http://stackoverflow.com/questions/7719374/batch-uploading-huge-sets-of-images-to-azure-blob-storage?rq=1 – Kulasangar Feb 06 '15 at 10:39

1 Answers1

0

The storage client library allows you to upload / download individual blobs. You can of course use standard .NET techniques to perform multiple blob operations in parallel.

Jason Hogg - MSFT
  • 1,369
  • 9
  • 10