I am new to FORGE API development and I'm trying to develop a console application to manage data with FORGE API,These are the steps I have followed so far
1.I have successfully registered an APP on FORGE
2.Then I have acquired a OAuth token using 2-legged authorization.
3.After that I have successfully created a bucket on FORGE to upload my files
4.Finally I tried to upload a small text file to the bucket and it worked,but when I try to upload a revit file (around 18 MB) its getting an exception "More than one error".
This is the code I'm using to upload the file
string filePath = @"C:\Users\Administrator\Desktop\Demo revit file\sample.rvt";
string url = "https://developer.api.autodesk.com/oss/v2/buckets/mybucket/objects/sample.rvt";
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken);
var response= client.PutAsync(url, new StreamContent(File.OpenRead(filePath))).Result.EnsureSuccessStatusCode();
string res = response.ToString();
Console.WriteLine("Response: " + res);
}
Please help me to resolve this.