Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

Error invalid server error 500 when try to post the file via web api request

(0) ShareShare
ReportReport
Posted on by 22
Hi All,
 
i got the error invalid server error 500 when try to upload file bytes
 
 
Could anyone help me to correct the code that i missed?
 
Thanks,
it.dev
 
  • Suggested answer
    Hana Xue Profile Picture
    Hana Xue Microsoft Employee on at
    Error invalid server error 500 when try to post the file via web api request
    Hi,
    There are many reasons for this problem, you can check the following two blogs about this issue. Hope these will help you.
    Error 500 on the server for D365 finance and operations (axonmymind.blogspot.com)
    HTTP 500 errors running Dynamics 365 for Finance and Operations in locally hosted onebox / development VM – Learning Dynamics 365 for Operations / X++ (tech.blog)
    If your problem is urgent, it is recommended that you open a ticket with Microsoft for better support.
    Best Regards,
    Hana
  • Martin Dráb Profile Picture
    Martin Dráb 230,836 Most Valuable Professional on at
    Error invalid server error 500 when try to post the file via web api request D365fo x++
    The error code just tells you that something failed on the server, but as you see, it's not enough information to know what to fix. You'll need to find more details. I don't know what service you're calling, so I can't tell you what data it expects and where you can find logs.
     
    By the way, there is a problem in your code. You release resources of streamWriter only when things succeed, but not if an exception is thrown. The 'using' statement is easier to use and handle both cases.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,965 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,836 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans