webdav_client icon indicating copy to clipboard operation
webdav_client copied to clipboard

wdWriteWithStream does not work with dio 5.0.1

Open nicolaspernoud opened this issue 2 years ago • 4 comments

Hello, thanks for this very nice package.

It seems that since updating to dio 5, on Web, the wdWriteWithStream functions gives an error. Catching this error gives a DioError: null, but digging forward seems to indicate that the stream is consumed twice along the line.

It works with Android though.

Best regards.

nicolaspernoud avatar Feb 28 '23 14:02 nicolaspernoud

It seems that forcing the content type to be "application/octet-stream" into the client solves the error. It prevents from trying to guess the content type from the stream and consuming it...

client.c.options.contentType = "application/octet-stream";

nicolaspernoud avatar Feb 28 '23 15:02 nicolaspernoud

@nicolaspernoud thanks very much. I seem to have found another problem that "dart: io" is not suitable for the web platform. I need time to properly reconstruct the project. The problem you mentioned may be caused by the modification of the "_transformData" method in "dio: 5.0". I may fix the bug and fully test the web platform to make it universal during project reconstruction.

flymzero avatar Mar 02 '23 13:03 flymzero

Good news. By the way, there is another problem that I found, but I think it is caused by dio as well : it it not possible to upload large (several Gb) files with web : it seems that dio does not really stream the data (!?).

nicolaspernoud avatar Mar 02 '23 15:03 nicolaspernoud