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

Community site session details

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

How to upload file with custom services

(1) ShareShare
ReportReport
Posted on by 16

 

I have any type of file to upload using Custom Service.

I need to upload this file to D365FO via a Custom Service call.

I am wondering how we pass the file to the custom service.  What would be the data type? 

 

I have tried with different parm data types like (System.Byte[]  , System.IO.Stream, StreamIo) and passed to my method that accesses the file from Postman but the same error was found after sending the request.

 

my custom service class mehod is >

 public str uploadAttachment(System.Byte[]  _file)
    {
        str result;
        try
        {
            if(_file)
            {
                result =/file read/;
            }
            else
            {
                result =/file not read/;
            }
        }
        catch
        {
            return result;
        }
        return result;
    }
 
sent request and the postman error is >
 
 
Need help ..... how I can achieve this?
 

 

I have the same question (0)
  • Martin Dráb Profile Picture
    236,045 Most Valuable Professional on at
    How to upload file with custom services
    Moved from Dynamics AX forum.
     
    Is your requirement using the JSON-based endpoint? Would using a Base64-encoded string be an option for you?
     
    By the way, it sounds like a continuation of the discussion in Post and update person image with custom services in x++.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 895

#2
Sohaib Cheema Profile Picture

Sohaib Cheema 811 User Group Leader

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 787 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans