Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

201
Views
Uploading blob to Azure Storage using JS and SaS url

I'm using a combination of C# and JS to upload a file to Azure storage (using C# I create a SaS URL for the blob and JS just to upload the file through the browser). I have a problem with Blob ContentType. When I create a Blob using C# by loading string.Empty

blobClient.Upload(string.Empty, new BlobHttpHeaders()
{
    ContentDisposition = "newFile.png",
    ContentType = "image/png"
});

Everything is fine in the Azure portal, but when I upload the file using JS ("@azure/storage-blob" https://docs.microsoft.com/en-us/javascript/api/@azure/storage-blob/blockblobclient?view=azure-node-latest#@azure-storage-blob-blockblobclient-uploaddata)

await blockBlobClient.uploadData(file);

It will overwrite ContentType.

I could use

await blockBlobClient.uploadData(file, {
    blobHTTPHeaders:{
        blobContentDisposition: file.name,
        blobContentType: file.type
    }
});

But I don't want to use it in JS because anyone can write anything in Source. Is there any way to use something like Static ContentType for blob or inject in SaS ContentType (injection in BlobSasBuilder doesn't work)

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!