This question is really about Postman and not a MS product. You should ask in their forum. If you check in their forums there are several questions related to this and several solutions. Here is one of many - link.
AZURE REST API - How to upload PDF using base64?
I'm trying to upload pdf files to a storage account using the azure rest api.
I can upload the files using binary, but when uploading using base64 my file seems to be corrupted in the upload process.
The file sending process gives me a status of 201 (201 Created), but when downloading the file to Azure, I receive an error saying: Failed to load the PDF document.
requests and prints below:
curl:
curl --location --request PUT 'https://
2 answers
Sort by: Most helpful
-
-
Ryan Hill 28,106 Reputation points Microsoft Employee
2024-07-09T21:45:34.78+00:00 Hi @GUILHERME RODRIGUES SILVA DE JESUS
After reviewing Put Blob (REST API) - Azure Storage | Microsoft Learn, one thing I can suggestion is verifying the page blob uploaded correctly by using Storage Explorer. If you see the blob and can download it from in Storage Explorer as a PDF, then you know the upload operation is good. If not, then you the issue is either with the body or not setting the content-type of the blob itself. Put Blob (REST API) - Azure Storage | Microsoft Learn doesn't mention sending the payload as JSON so I would just try uploading bytes as is and setting the content type to application/pdf.
If you're using Postman to test with, then I would also strongly suggest utilizing one of the SDKs so you can follow the best security guidelines and Authorize access to blobs using Microsoft Entra ID - Azure Storage | Microsoft Learn.