none
generate sprite thumbnail RRS feed

  • Question

  • Hello 
    my question is i generate multiply sprite thumbnail and i download all vtt files local and make concat for all vtt files and then i need to upload it to output job asset 
    its give me this error :
    err null"
    upload status doneUpload
    upload status res 403
    upload status body <?xml version="1.0" encoding="utf-8"?><Error><Code>AuthenticationFailed</Code><Message>Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
    RequestId:742774a4-901e-00c6-0df6-455a6a000000
    Time:2019-07-29T10:13:53.2270016Z</Message><AuthenticationErrorDetail>Signature did not match. String to sign used was 

    2019-07-29T11:43:48Z
    /blob/shahiddevtest/asset-58581690-2895-43f2-ace3-e3ba0278841b"

    36dfd538-157f-4d7d-86e1-bb1c04ec67c5


    2017-04-17

    and the code is :

    fs.readdir(FolderLocalToUpload, (err, files) => {
                                            console.log("files",files)
                                            files.forEach(function(elem){
                                            console.log("elem",elem)
                                            var urlForUpload="https://shahiddevtest.blob.core.windows.net/asset-"+outputAssetId+"\\"+elem+bodyLocaterForUpload.ContentAccessComponent
                                            console.log("urlForUpload-----------------------------",urlForUpload)
                                            fs.readFile("C:\\Users\\afsmadi\\Desktop\\mediaFunction Afaq\\"+souresAsset+"\\vttResult\\"+elem, (err, data) => {
                                            var file=data
                                            request(
                                            {
                                            headers: headerForUploadFiles , 
                                            uri:urlForUpload, 
                                            method:'PUT',
                                            body:file
                                            }, function (err, res, body) {
                                            console.log("upload status","doneUpload")
                                            console.log("upload status res",res.statusCode)
                                            console.log("upload status body",body)
                                            console.log("err",err)
                                            // rimraf('C:\\Users\\afsmadi\\Desktop\\mediaFunction Afaq\\'+souresAsset, (err) => {
                                            //     if (err) {
                                            //     console.error(err)
                                            //     }
                                            //     console.log("done the foder is deleted"+souresAsset)
                                            // })
                                            });
                                            })
                                            })
                                            })


                                        //////

                                    })


                             

    Monday, July 29, 2019 12:00 PM

All replies

  • Hello,

    Looks like a permission issue. You may need to generate a SAS locator (with write permissions) in order to upload files (blobs) to the Azure Storage Container.

    Something like :

    ListContainerSasInput parameters = new ListContainerSasInput().withPermissions(AssetContainerPermission.READ_WRITE).withExpiryTime(DateTime.now().plusHours(4));
    AssetContainerSas response = manager.assets().listContainerSasAsync(resourceGroupName, accountName, assetName, parameters).toBlocking().first();
    URI sasUri = new URI(response.assetContainerSasUrls().get(0));
    CloudBlobContainer container = new CloudBlobContainer(sasUri);
    String fileToUpload = ("C:\\Users\\afsmadi\\Desktop\\mediaFunction Afaq\\"+souresAsset+"\\vttResult\\"+elem;
    File file = new File(fileToUpload);
    CloudBlockBlob blob = container.getBlockBlobReference(file.getName());
    blob.uploadFromFile(fileToUpload);


    Monday, July 29, 2019 12:48 PM