I am attempting to upload a DWF to my forge app's bucket (already created and functioning properly) from disk in C# using RestSharp
I get a successful response from my PUT request, but when I try to translate the DWF using the model derivative API, the manifest for the job returns a failed status, with an error code "DWF2D-Not_A_DWF_Error"
I have not had good luck finding examples to reference (most are in curl or deal with model content already on bim360)
Any ideas what could be wrong with my PUT request to upload to bucket?
byte[] byteFile = GetBinaryFile($"C:\\temp\\RoomView_{this.guid}.dwf");
RestClient client = new RestClient($"https://developer.api.autodesk.com/oss/v2/buckets/{this._bucket_key}/objects/RoomView_{this.guid}.dwf");
RestRequest request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer " + _auth_token.access_token);
request.AddHeader("Content-Length", byteFile.Length.ToString());
request.AddParameter("application/octet-stream", byteFile);
var response = client.Execute(request);
GetBinaryFile looks like this:
private byte[] GetBinaryFile(string filename)
{
byte[] bytes;
using (FileStream file = new FileStream(filename, FileMode.Open, FileAccess.Read))
{
bytes = new byte[file.Length];
file.Read(bytes, 0, (int)file.Length);
}
return bytes;
}