Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

209
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda