-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FileUpload error: "Error while copying content to a stream" #17
Comments
Ok, I could resolve it by using byte[] instead of the filename to upload. Maybe the filename upload function should also just read the file and convert to byte[] ? Cheers |
Thanks for reporting this issue. Currently it loads the file using |
Actually this should also work and is described as more flexibal and testable. |
I've published a new version that uses |
Unfortunately I can't really test it because now I get a JSON parse error for any action that returns something: Unhandled exception. System.Text.Json.JsonException: The JSON value could not be converted to System.Int32. Path: $.data.folders[0].additional.owner.gid | LineNumber: 0 | BytePositionInLine: 60. The commands (like login or folder creation) are executed, but there seems to be a problem with the returned json parsing. I'm on latest .net7 environment. |
Would you be able to capture the returned JSON and send it to me? I'm unable to reproduce the error. I've added a sample .NET 7 console application to the repository which works fine for me. I've also published a new version but I only fixed some of the NRT warnings so it probably won't make much difference. |
Hi,
I'm getting the following exception when trying to upload a file:
Unhandled exception rendering component: Error while copying content to a stream.
System.Net.Http.HttpRequestException: Error while copying content to a stream.
---> System.ObjectDisposedException: Safe handle has been closed.
Object name: 'SafeHandle'.
at Interop.Sys.PRead(SafeHandle fd, Byte* buffer, Int32 bufferSize, Int64 fileOffset)
at System.IO.RandomAccess.ReadAtOffset(SafeFileHandle handle, Span`1 buffer, Int64 fileOffset)
at Microsoft.Win32.SafeHandles.SafeFileHandle.ThreadPoolValueTaskSource.ExecuteInternal()
The project is .NET7 Blazor Server and same error on console app on macos.
I can login correctly, list all shares, but the upload raises this error. Local file name is correct, target share+folder is correct and user has write access.
The request reads:
var uploadResult = await client.FileStationApi().UploadEndpoint().UploadAsync("/Users/Kerry/Desktop/test.pdf", "/System/Upload", true);
What else could I check?
Thanks
Kerry.
The text was updated successfully, but these errors were encountered: