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 6605773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:19:26+00:00 2026-05-25T19:19:26+00:00

I am trying implement Using local storage with BLOB storage . I went through

  • 0

I am trying implement Using local storage with BLOB storage .
I went through http://allcomputers.us/windows_azure/using-local-storage-with-blob-storage-(part-1)—using-a-local-cache—defining-and-accessing-local-storage.aspx
and re factored my GetBlob method as below .

public Stream GetBlob(string blobAddress, string CONTAINER_NAME)
    {
        MemoryStream stream = null;
        stream = CheckInLocalCache(blobAddress);
        if (stream==null)
        {
            CloudBlobContainer container = Client.GetContainerReference(CONTAINER_NAME);
            if (container != null)
            {
                stream = new MemoryStream();
                container.GetBlobReference(blobAddress).DownloadToStream(stream);
            }
        }

        return stream;
    }

    private static MemoryStream CheckInLocalCache(string blobAddress)
    {
        MemoryStream localBlobStream=null;
        LocalResource localBlobCache = RoleEnvironment.GetLocalResource("localBlobCache");
        if (localBlobCache != null)
        {
            string localCacheRootDirectory = localBlobCache.RootPath;
            string blobName = blobAddress.Split('/')[blobAddress.Split('/').Length - 1];
            if (File.Exists(localBlobCache.RootPath + blobName))
            {
                localBlobStream = new MemoryStream(File.ReadAllBytes(localBlobCache.RootPath + blobName));
            }               
        }
        return localBlobStream;
    }

In Config file i added this

<WebRole name="ServiceRuntimeWebsite">
   <LocalResources>
      <LocalStorage name="localBlobCache"
                    cleanOnRoleRecycle="true"
                    sizeInMB="100" />
   </LocalResources>
</WebRole>

When i run my prject in development environment , i see the folder “localBlobCache” is created . But even after many times loading blobs from azure it never really loaded to my local storage . Can anyone tell Whats wrong ?

  • 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-05-25T19:19:27+00:00Added an answer on May 25, 2026 at 7:19 pm

    It doesn’t look like anything in the code you shared saves the file to the cache directory. You probably want something in GetBlob that saves the blob to a file if it isn’t already there.

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

Sidebar

Related Questions

As part of a larger project I'm trying to implement a facility using JOGL
trying to implement a dialog-box style behaviour using a separate div section with all
I have been trying to implement Win32's MessageBox using GTK. The app uses SDL/OpenGL,
I am trying to implement an application by using MySQL/JAVA and I found this
I'm trying to implement a WPF application using MVVM (Model-View-ViewModel) pattern and I'd like
I'm trying to implement a stateful web service in PHP using the SOAP extension.
I'm trying to implement a comet style, long polling connection using an XMLHttpResponse object.
I'm trying to implement an undo/redo feature into my application, using the Command Pattern
I'm new to Flex SDK and trying to implement a simple project using Doug
I'm using Django to write a blog app, and I'm trying to implement 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.