0

I'm using filestack-js in my project and i'm sometimes uploading directly from the client like this

const returnValue = client.upload(file, {}, pickerStoreOptions);

So far i was uploading on an amazon s3 bucket, everything was working fine. But for some technical reason my project is migrating on azure blob containers. So i'm migrating my code on it.

When i'm uploading from the picker everything is working fine just like before. But when i'm uploading like i showed you, i'm recieving a response before the upload is over, so i'm getting an object like this in response :

{
    "container": undefined,
    "key": undefined,
    "uploadTags": undefined,
    "workflows": undefined,
    "_sanitizeOptions": undefined,
    "_file": {
       "name": "cg2O8Nr6TlunYP8Nruec_vMNgEHydQ0eXzABPGcDU_Flf9pT0XgAAtlku_thumb.jpeg",
       "size": 55842,
       "type": "image/jpeg"
    }
    "name": "cg2O8Nr6TlunYP8Nruec_vMNgEHydQ0eXzABPGcDU_Flf9pT0XgAAtlku_thumb.jpeg",
    "status": "InTransit",
    "type": "image/jpeg",
    "size": 55842,
    "url": "https://cdn.filestackcontent.com/7lthzeqLSNKGvuJw3RfP",
    "handle": "7lthzeqLSNKGvuJw3RfP"
}

Problem is : this status "InTransit" that means the file isn't on my blob container yet, and the key as undefined. I'm using this key is the following of my code, so i can't make it work like that.

My question is : how can i wait for the ending of the upload and get a complete object with his key.

Really i'm out of solution right now ... If you know how i can do that you will be very welcome.

Thanks by advance

0 Answers0