Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

the server responded with a status of 413 () while attaching grater than 5 mb file

(2) ShareShare
ReportReport
Posted on by 93

I want attachment my file with file size greater than 5MB, but Error.

Do you can help me?

How to increase max file size for attachment?

And can i change max file size in my f&o ? If can, how?

i already tried https://community.dynamics.com/forums/thread/details/?threadid=49167a6e-2c8c-4591-80ad-27bf2125a03d this blog suggestion,

even i am getting same error

Thanks all..

  • Martin Dráb Profile Picture
    234,290 Most Valuable Professional on at
    the server responded with a status of 413 () while attaching grater than 5 mb file
    Next time, please tell us what you're doing at beginning. Otherwise we all waste our time trying to solve a wrong problem because of wrong information. It useless for you and frustrating for us.
     
  • Dillibabu Profile Picture
    93 on at
    the server responded with a status of 413 () while attaching grater than 5 mb file
    yes  the api is custom service  and i have no exception in X++ 
     
    and i have build the custom control for accept drag and drop files in the control while the user put file in the control i try to send the control to my custom method to process the attachments while in this process i get error the file is too large by using this method 
     
    const response = await $dyn.callFunction(self.UploadFile, self, {
        _fileName: file.name
    });
     
    so i create one custom service to send the file to the attachment process custom method to attach the file against record i use the below code 
     
    DocuRef docuRef = this.createDocuRefFromCommon(request);
    DocuActionFile docuActionFile = DocuAction::newDocuRef(docuRef);
    str filename, ext, path;
    [path,Filename,ext] = fileNameSplit(request.parmFileName());
      
    System.Byte[] messageBytes = System.Convert::FromBase64String(request.parmbase64());
    System.IO.MemoryStream memoryStream = new System.IO.MemoryStream(messageBytes);
    if(docuRef)
    {
        docuActionFile.attachFile(docuRef,request.parmFileName(), ext,memoryStream);
    }
  • Martin Dráb Profile Picture
    234,290 Most Valuable Professional on at
    the server responded with a status of 413 () while attaching grater than 5 mb file
    Unfortunately, your answers don't really address my questions.
    1. docuref.attachfile() is an X++ method, not the type of storage. The question is where F&O will store the imported file. See Location in Organization administration > Document management > Document types:

      But you seem to be saying that attaching large files actually works; you had a problem somewhere else.
    2. How is the Javascript related to the problem? Are you saying that there is no problem in F&O code, but in some client code of yours? You claimed there is a problem inside F&O, therefore I assumed you're calling F&O and it fails inside, but maybe it's not the case. We can't check anything if you tell us nothing about what you're doing and where it's failing.
      Aren't you actually developing an extensible control?
      I shouldn't be trying to guess what you're doing. If you want our help, you should give some basic information about the problem.
    3. So you have no exception in X++, right? Do you have some JS code that fails to even before calling F&O? 
    I can't suggest a better solution, because your description of both the problem and your approach are too vague.
     
    What do you mean by "we cannot send file via webserver with the large size"? What is the actual problem? It's not true that web servers can't accept larger files. If it was true, nothing on the web could use larger files than 5 MB, because the web runs on web servers. That's clearly not the case. Don't you actually mean your client JS code when talking about a web server?
     
    What do you mean by "one api service in d365"? A custom service? What did you use before?
     
     
  • Verified answer
    Dillibabu Profile Picture
    93 on at
    the server responded with a status of 413 () while attaching grater than 5 mb file
    @Martin Dráb ,@Adis thanks for your responses,
     
    i have found the solution for the problem,
     
    the problem is we cannot send file via webserver with the large size 
     
    so i have create one api service in d365 and call the api in my javascript to send the file to create docuref against my record 
     
    is there any possible ways to do this in better ways share your thoughts 
     
    thank you
  • Dillibabu Profile Picture
    93 on at
    the server responded with a status of 413 () while attaching grater than 5 mb file
     
    Which type of storage are you using for attachements : i am using docuref.attachfile() to store the file against record
     
    Which line of code is throwing the exception : i am gettiing error in standard js class jquery3.5.0.min.js while executing my custom cuntrol js class line 
    const response = await $dyn.callFunction(self.UploadFile, self, {
        _fileName: file.name
    });
     
    error :file too large error 
     
    this error is not capture in f&o i capture this error while debug the js code in browser 
     
    thanks for your responce.
     
  • Martin Dráb Profile Picture
    234,290 Most Valuable Professional on at
    the server responded with a status of 413 () while attaching grater than 5 mb file
    Please give us more information about the situation.
     
    Which type of storage are you using for attachements?
     
    Which line of code is throwing the exception?
     
    What's the error message?
     
    The thread you've mentioned isn't about F&O at all and therefore the discussion there about things like MaxRpcSize isn't really relevant to your situation.
  • Suggested answer
    Adis Profile Picture
    4,846 Super User 2025 Season 1 on at
    the server responded with a status of 413 () while attaching grater than 5 mb file
    Hi,
     
    In this case I would create a Microsoft Ticket as you have no influence on their servers.
     

    Kind regards, Adis

     

    If this helped, please mark it as "Verified" for others facing the same issue

    Keep in mind that it is possible to mark more than one answer as verified

  • Dillibabu Profile Picture
    93 on at
    the server responded with a status of 413 () while attaching grater than 5 mb file
    Thank you for your response @Adis
     
    Yes, i have already tried that also,
     
    The error is from webserver side 
  • Suggested answer
    Adis Profile Picture
    4,846 Super User 2025 Season 1 on at
    the server responded with a status of 413 () while attaching grater than 5 mb file
    Hi,
     
    Have you checked out this setup described here:
     
     

    Kind regards, Adis

     

    If this helped, please mark it as "Verified" for others facing the same issue

    Keep in mind that it is possible to mark more than one answer as verified

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 601 Most Valuable Professional

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 416

#3
Adis Profile Picture

Adis 384 Super User 2025 Season 1

Product updates

Dynamics 365 release plans