Giter Site home page Giter Site logo

Not able to upload image to blob storage - exception com.microsoft.azure.storage.StorageException: The specified resource does not exist. in line -> blobFromSASCredential.uploadFromFile(mPhotoFileUri.getPath()); about azure-storage-android HOT 7 CLOSED

azure avatar azure commented on September 25, 2024
Not able to upload image to blob storage - exception com.microsoft.azure.storage.StorageException: The specified resource does not exist. in line -> blobFromSASCredential.uploadFromFile(mPhotoFileUri.getPath());

from azure-storage-android.

Comments (7)

emgerner-msft avatar emgerner-msft commented on September 25, 2024

entity.getSasQueryString()

How are you generating the sas query string?

from azure-storage-android.

amanpwl92 avatar amanpwl92 commented on September 25, 2024

var azure = require('azure');
var qs = require('querystring');
var appSettings = require('mobileservice-config').appSettings;

function insert(item, user, request) {

var accountName = appSettings.STORAGE_ACCOUNT_NAME;
var accountKey = appSettings.STORAGE_ACCOUNT_ACCESS_KEY;
var host = accountName + '.blob.core.windows.net';

var blobService = azure.createBlobService(accountName, accountKey, host);

// Provide write access to the container for the next 5 mins.        
var sharedAccessPolicy = {
    AccessPolicy: {
        Permissions: azure.Constants.BlobConstants.SharedAccessPermissions.WRITE,
        Expiry: new Date(new Date().getTime() + 5 * 60 * 1000)
    }
};

// Generate the upload URL with SAS for the new image.
var sasQueryUrl =
    blobService.generateSharedAccessSignature('prescriptions',
        item.resourcename, sharedAccessPolicy);

// Set the full path on the new new item, 
// which is used for data binding on the client. 
item.imageUri = sasQueryUrl.baseUrl + sasQueryUrl.path;
request.execute();

}

from azure-storage-android.

emgerner-msft avatar emgerner-msft commented on September 25, 2024

I'm still unclear what getSasQueryString returns and I see a couple issues with the Node code you've published:

  1. What version of the storage Node lib is this on? At least in the newer versions generateSharedAccessSignature returns just the SAS query, not an entire URL.
  2. Assuming you have a valid url, I see you've taken only the baseURL and the path, but SAS is a query. Where are you actually doing anything with the SAS token?

from azure-storage-android.

lanrehnics avatar lanrehnics commented on September 25, 2024

Am having this kind of exception too but when I get the exception message ..It goes like "Address is a relative address. Only absolute address are permitted" So the question is how do I generate Absolute address..

from azure-storage-android.

emgerner-msft avatar emgerner-msft commented on September 25, 2024

That exception message means something pretty different I think. Could you post a new issue with the segment of your code having an issue and a stack trace please?

from azure-storage-android.

lanrehnics avatar lanrehnics commented on September 25, 2024

Have Opened it.. Thanks looking forward to your reply..

from azure-storage-android.

emgerner-msft avatar emgerner-msft commented on September 25, 2024

@amanpwl92 Haven't heard anything since Sep so closing this issue. Feel free to reopen with any follow up or start up a new issue if you have additional questions!

from azure-storage-android.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.