Skip to content
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

Chunk file upload not working #40

Open
alaxala opened this issue Nov 12, 2021 · 0 comments
Open

Chunk file upload not working #40

alaxala opened this issue Nov 12, 2021 · 0 comments

Comments

@alaxala
Copy link

alaxala commented Nov 12, 2021

When I try to upload file more than 16Mb to Innovator I get the exception (timeout, but it happens earlier than 100 sec as default timeout).
After some investigations I discovered that exception occurs at the second file chunk sent. Server returns http error 400. I think this is due to the lack of "Transfer-Encoding: chunked" in the http request header.
Ok. I made the chunkSize local variable of CommandFile.AsContent as public static member of CommandFile class and added

if (file.Length > CommandFile.chunkSize) req.SetHeader("Transfer-Encoding", "chunked");

to TransactionalUploadCommand.UploadFile.

But now I get the System.ObjectDisposedException at CommandFile.FileStreamContent.SerializeToStream.
Apparently for some reason the FileStreamContent object is disposed before its chunk is sent. I don't understand why this can happen.

Now as workaround I increased the chunkSize value to 500Mb and can upload large files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant