Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7851953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:18:11+00:00 2026-06-02T19:18:11+00:00

I have the following simple application page that uses the phone camera to upload

  • 0

I have the following simple application page that uses the phone camera to upload the taken photo to azure blob:

public partial class AddReport : PhoneApplicationPage
{
    // blobs stuff
    string storageAccount = "MYACCOUNT";
    string storageKey = "MYKEY";
    string blobServiceUri = "http://MYACCOUNT.blob.core.windows.net";
    CloudBlobClient blobClient;

    private Report newReport;
    public AddReport()
    {
        InitializeComponent();   
    }

    protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
    {
        //base.OnNavigatedTo(e);

        newReport = new Report();
        var credentials = new StorageCredentialsAccountAndKey(storageAccount, storageKey);
        blobClient = new CloudBlobClient(blobServiceUri, credentials);
    }

    private void TakePhotoClick(object sender, EventArgs eventArgs)
    {
        //The camera chooser used to capture a picture.
        CameraCaptureTask ctask;

        //Create new instance of CameraCaptureClass
        ctask = new CameraCaptureTask();

        //Create new event handler for capturing a photo
        ctask.Completed += new EventHandler<PhotoResult>(ctask_Completed);

        //Show the camera.
        ctask.Show();

    }

    void ctask_Completed(object sender, PhotoResult e)
    {

        if (e.TaskResult == TaskResult.OK && e.ChosenPhoto != null)
        {

            WriteableBitmap CapturedImage = PictureDecoder.DecodeJpeg(e.ChosenPhoto);
            UploadToBlobContainer(e.ChosenPhoto);
        }
        else
        {
            //user decided not to take a picture
        }
    }
    private void UploadToBlobContainer(System.IO.Stream stream)
    {
        string containerName = "reportsPhotos";
        var container = blobClient.GetContainerReference(containerName);

        container.CreateIfNotExist(true, r =>
            Dispatcher.BeginInvoke(() =>
            {
                var blobName = "report" + newReport.ReportId.ToString();
                var blob = container.GetBlobReference(blobName);
                blob.Metadata["ReportId"] = newReport.ReportId.ToString();
                blob.UploadFromStream(stream, r2 =>
                    Dispatcher.BeginInvoke(() =>
                    {
                         newReport.Photo = container.Uri + "/" + blobName;
                    }));
            }));

    }
}

This is a simple case and I am not using SAS to authenticate, instead I save the key in the app itself (this is only for testing purposes) and also my blobs are publicly available.

when I run in debug mode it seems that everything is working, but the photo doesn’t get uploaded to the blob. Also, I don’t know how I can debug this to see if there was any error from the blob service.

Can anyone tell me what might be wrong ?

EDIT1: it seems that the container is not being created either. i’ve confirmed this using azure blob explorer

EDIT2: I am getting a System.Net.WebException : "The remote server returned an error: NotFound."

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T19:18:14+00:00Added an answer on June 2, 2026 at 7:18 pm

    After long hours I have finally discovered that the problem was with this line:

    string containerName = "reportsPhotos";
    

    According to here all letters in a container name must be lowercase.
    Changing it to reportsphotos solved the issue

    That was time well spent.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lets say that you have a following simple application: <form action=helloServlet method=post> Give name:<input
I am using PHP and Smarty. I have a simple application that: Shows page
I have a simple ASP.NET page that uses the VLC media player to play
I have apsx page that has the following simple code: <%@ Page Title= Language=C#
I have a working Flex/BlazeDS application (for simple AMF remoting) with the following settings:
I have developed a simple application in GWT. After that, I generate war file
We have a simple ColdFusion page that is outputting basic HTML to the browser.
I am working on simple Workflow Foundation that uses a simple ASP.NET page as
We have a fairly simple mobile application, completed for iPhone and Android that does
My application is a simple WebView wrapper that displays a web page in a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.