Skip to content

Chunk file upload not working #40

Description

@alaxala

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions