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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Uploading files to Dat...
Power Apps
Unanswered

Uploading files to Dataverse suddenly stops working

(0) ShareShare
ReportReport
Posted on by 187

Hello,

I apologize if the topic is not in the right place, the problem is urgent and I'm looking for as much help as possible.

I am currently working on a project using Power Pages where I need to upload files to a Microsoft Dataverse record. The process involves creating a new Dataverse record and then uploading a file to a file column within that record using JavaScript (with the Web API).

 

Here's a snippet of the code that handles the file upload:

// ... (rest of the code)

const reader = new FileReader();
reader.onload = function (e) {
 const bodyContents = e.target.result;
 const buffer = new Uint8Array(bodyContents);

 // Wrap the safeAjax call in a new promise
 let innerPromise = new Promise((innerResolve, innerReject) => {
 webapi.safeAjax({
 type: "PUT",
 url: "/_api/cg_commandes(" + newRecordId + ")/cg_fichierstl?x-ms-file-name=" + USER.userCompanyCondensed + "-" + fileName,
 contentType: "application/octet-stream",
 processData: false,
 data: buffer,
 success: function (res, status, xhr) {
 console.log("File attached");
 innerResolve(); // Resolving the inner promise
 },
 error: function (xhr, status, error) {
 console.error("error: " + error);
 innerReject(error); // Rejecting the inner promise
 }
 });
 });

 innerPromise.then(() => {
 resolve(handlePromiseResult(null, 100 / promises.length)); // Resolve the external promise and update progress for this file
 }).catch((error) => {
 reject(error);
 });
};
reader.readAsArrayBuffer(file);

// ... (rest of the code)

 

The file upload fails since Saturday in dev and production environments (it is extremely problematical !!), not in qualification, and I'm unable to determine the cause. The error handling within the webapi.safeAjax call logs the error, but I haven't been able to resolve the issue from the error messages I'm receiving.

Here is the error :

{
 "error": {
 "code": "9004010D",
 "message": "Common Data Service error occurred.",
 "cdscode": "0x80040217",
 "innererror": {
 "code": "0x80040217",
 "message": "No file attachment found for attribute: cg_fichierstl EntityId: 7ecabfd7-7266-ee11-9ae7-000d3a95b11f."
 }
 }
}

 

I'm looking for any advice or suggestions on how to resolve this file upload issue. Has anyone encountered a similar problem, or does anyone have insights on how I might troubleshoot or fix this issue?

Thank you in advance for your assistance!

I have the same question (0)
  • Michael E. Gernaey Profile Picture
    53,452 Super User 2025 Season 2 on at

    @CharlesPP 

     

    It sounds to me like someone published a change to the solution

    Can you look in the solution history and see if that is the case?

     

    its that or someone did something to that table specifically. 

    First thing I would do honestly is review any changes to the system.

     

    it is possible.. that a patch came in from Microsoft (yes this happens) and that patch is actually breaking your upload. 

     

    So start with history updates first.

     

    Also, since the Upload is coming from a Power Page, verify your pages haven 't changed or that there is an Ajax change.

     

    If you truly see none, then I would open a ticket asap with Microsoft Support.


    If you like my answer, I would really appreciate if you please Mark it as Resolved, and give it a thumbs up, so it can help others

    Cheers

    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

  • CharlesPP Profile Picture
    187 on at

    Thank you for your answer !

    The problem suddenly disappeared (as it happened) without any action on our part, I am the only developer on this tenant and no action has been taken for months. I'm very much leaning towards a Microsoft problem, and I'd like to open a ticket to get confirmation of what happened, as it generated a lot of stress and a lot of problems. I'd like to make sure it doesn't happen again.
    If you have a procedure so that I can open a ticket, it would be a pleasure.
    Thank you very much!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard