Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

C# / RestSharp file uploads

Community Beginner ,
Sep 14, 2021 Sep 14, 2021

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.

TOPICS
SDK , Send documents
2.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation