You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I have read the help guide on https://sftpgo.stoplight.io/docs/sftpgo/4ac40206614d5-upload-files but i'm still struggling to get my code to work
I am getting 400 - bad request responses, saying no files have been uploaded
I am using the RestSharp nuget package to do this
var client = new RestClient(//OurURL);
var request = new RestRequest("api/v2/user/files", Method.Post);
request.AddHeader("Content-Type", "multipart/form-data");
request.AddHeader("Authorization", "Bearer " + accesstoken);
request.AddParameter("path", HttpUtility.UrlEncode(@"BB-Test"));
request.AddParameter("filenames", JsonConvert.SerializeObject(new List { @"C:\Uploadtest\Test1.txt", @"C:\Uploadtest\Test1 - Copy.txt" }), ParameterType.RequestBody);
RestResponse response = client.Execute(request);
Any help would be greatly appreciated
Beta Was this translation helpful? Give feedback.
All reactions