Open mmartin78 opened 7 years ago
In addition, not all streams support synchronous reads.
System.NotSupportedException: Synchronous reads are not supported.
at Microsoft.AspNetCore.Components.Forms.BrowserFileStream.Read(Byte[] buffer, Int32 offset, Int32 count)
at System.IO.BufferedStream.Read(Byte[] array, Int32 offset, Int32 count)
at Autodesk.Forge.Client.ApiClient.toByteArray(Object obj)
@mmartin78 - I am not sure what needs to be changed - is the whole code to be replaced by one line?
ObjectApis.UploadObject and ObjectApis.UploadObjectAsync fail for certain types of streams. We are using the following WebApi code (some parts omitted) and it crashes:
We have tracked it down to the following code in ObjectsApi.cs which does not seem to be handling streams properly:
We have created a quick fix in a local build, but it would be nice to be able to use the official NuGet library. The fix is simply replacing the above code with this:
We can submit a pull request if needed.