web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Need syntax for adding...
Power Apps
Answered

Need syntax for adding the content type for AzureBlobStorage.CreateBlockBlob

(0) ShareShare
ReportReport
Posted on by 67

When I upload from PowerApps using

AzureBlobStorage.CreateBlockBlob("/filecabinet/", varFilename, UploadFileButton.Media) It is uploading the blob as an octet-stream when I need it as a pdf.  
 
How do I add the content type 'application/pdf', can't find the syntax anywhere.
 
Thanks!
Categories:
  • Verified answer
    SpongYe Profile Picture
    5,909 Super User 2026 Season 2 on at

    Hi @mrscherry2000 

     

    Can you try to update your expression as:
     

     

    AzureBlobStorage.CreateBlockBlob(
     "/filecabinet/", 
     varFilename, 
     UploadFileButton.Media, 
     {'Content-Type': "application/pdf"}
    )

     

     

    If you have any questions or feedback, please let me know. Have a great day! 😊

    -----------------------
    PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]

    I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻

  • Verified answer
    mrscherry2000 Profile Picture
    67 on at

    That was it!  Thank you so much! 

  • mrscherry2000 Profile Picture
    67 on at

    I thought this worked as I intended it which was to upload PDFs as BlockBlocks but when I look in Azure, I see the content type is still an octet-stream instead of a PDf?  Any ideas?  This is my full code I'm using:

    AzureBlobStorage.CreateBlockBlob(
        "/filecabinet/",
        varFilename,
        UploadFileButton.Media,
        {'Content-Type': "application/pdf"}
    );

     

     

  • KimSorensen Profile Picture
    27 on at

    Hi,

    I've spent some time trying this out too with the same result.

    After som testing (2 hours), I've found out that it's the wrong function to call 🙂

    You need to use this instead:

    AzureBlobStorage.CreateFile(

    "/filecabinet/",
        varFilename
        UploadFileButton.Media,

    );

    This will work, even without the Content-Type (as this is automatically detected and set during upload).

    Hope it helps someone out 🐵

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard