Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Unanswered

How to attach file file while creating a record in Dynamic 365 using Web API

(0) ShareShare
ReportReport
Posted on by 15

I am using Dynamic 365 Web API for creating a record using Mobile App. Everything is working fine, but I am stuck on uploading a file using the web API. I have gone through this link https://docs.microsoft.com/en-us/powerapps/developer/data-platform/file-attributes. and tried using the method mentioned, but still, it is not working.

Please help!!

  • Devender Adlakha Profile Picture
    15 on at
    RE: How to attach file file while creating a record in Dynamic 365 using Web API

    Hi Charan Raju

    I am using POSTMAN and sending a PATCH request on

    yourdomain.api.crm8.dynamics.com/.../s36000_ic

    with the following headers{

    x-ms-file-name:ic.png,

    x-ms-transfer-mode:chunked

    }.

    after this request is triggered I get a location variable from the response header and again I am making a PATCH request on this:

    yourdomain.api.crm8.dynamics.com/.../s36000_ic

    with the following headers

    {

    Content-Range : bytes 0-33554431/*

    Content-Type : application/octet-stream

    x-ms-file-name : ic.png

    Content-Length : 10737456

    }

    but still, i am getting an error

  • Charan Raju C R Profile Picture
    7 Moderator on at
    RE: How to attach file file while creating a record in Dynamic 365 using Web API

    Hi Devendar,

    Could you please post your code here?

  • Devender Adlakha Profile Picture
    15 on at
    RE: How to attach file file while creating a record in Dynamic 365 using Web API

    Hi Charan Raju C R

    I am storing data at 2 Places, first, I am making a post request on to my server and uploading the image into the database by converting it into the base64 format.

    now when my base64 string is stored in the database I am using the dynamics 365 web API for file upload.

    my backend API's are created in laravel and from laravel I am using HTTP::Patch Request with bearer token.

  • Charan Raju C R Profile Picture
    7 Moderator on at
    RE: How to attach file file while creating a record in Dynamic 365 using Web API

    Hi Devender,

    How are you uploading the file? Using HTML webresource to browse and select the file for uploading from mobile device?

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 181 Super User 2025 Season 1

#2
Siv Sagar Profile Picture

Siv Sagar 149 Super User 2025 Season 1

#3
Vahid Ghafarpour Profile Picture

Vahid Ghafarpour 124 Super User 2025 Season 1

Product updates

Dynamics 365 release plans