Skip to main content
Participant
September 14, 2021
Question

C# / RestSharp file uploads

  • September 14, 2021
  • 0 replies
  • 2196 views

Looking to pick some brains here.  I'm attempting to post a PDF to the transientDocuments endpoint and running into some (probably very basic) issues - wanted to see if anyone else here ran into the same thing.

 

In the RestRequest, I've tried the .AddFile() function and also the .AddFileBytes() function, but both ways gives me a error stating: 

 

NO_FILE_CONTENT","message":"Must provide file body"

 

Code in question:

//request.AddFile(displayName, fileName, "multipart/form-data");

//request.AddFileBytes(displayName, System.IO.File.ReadAllBytes(fileName), displayName, "multipart/form-data");

 

I am including the File-Name and Mime-Type parameters on the request.

This topic has been closed for replies.