Closed SailReal closed 4 years ago
I had done the same changes and tried uploading a >2GB file...at the end there was some error which stated that upload session failed multiple times. Don't remember the exact words, but I think there's a restriction in OneDrive endpoint itself and the use of 'int' instead of 'long/Long' seems to be intended by the Microsoft developers.
@SailReal Have you actually tried uploading a 2GB+?
@dknchris without the fix I get an java.security.InvalidParameterException: Stream size should larger than 0.
. With the changes, uploading the same file works.
But I don't know if there is another (higher) limit on the server side...
Edit: The size of the tested file is 2.15GB
Just found out that the download of this uploaded file throws always? an exception, maybe that's what you observed @dknchris?
Caused by: javax.net.ssl.SSLException: Read error: ssl=0x712c67b488: I/O error during system call, Connection reset by peer
at com.android.org.conscrypt.NativeCrypto.SSL_read(Native Method)
at com.android.org.conscrypt.NativeSsl.read(NativeSsl.java:399)
at com.android.org.conscrypt.ConscryptFileDescriptorSocket$SSLInputStream.read(ConscryptFileDescriptorSocket.java:546)
at com.android.okhttp.okio.Okio$2.read(Okio.java:136)
at com.android.okhttp.okio.AsyncTimeout$2.read(AsyncTimeout.java:211)
at com.android.okhttp.okio.RealBufferedSource.read(RealBufferedSource.java:50)
at com.android.okhttp.internal.http.Http1xStream$FixedLengthSource.read(Http1xStream.java:393)
at com.android.okhttp.okio.RealBufferedSource$1.read(RealBufferedSource.java:371)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:286)
at java.io.BufferedInputStream.read(BufferedInputStream.java:347)
...but in my opinion, this is another problem.
Edit: Maybe I had some internet problems before, now I can reproducible download the file without getting a javax.net.ssl.SSLException
@SailReal I just checked my notes and it was an Upload session failed too many times error. In my case the file continued to be transferred/uploaded to the server and threw this error at the end! Weird right? These made me realize that this 2 GB restriction is rather deliberate and enforced from OneDrive servers themselves.
Its surprising to see that in your case the file gets uploaded at the least.
PS: I tested this on Android by uploading a 2.0+ GB game data file using the msgraph java sdk...
Just retested it again, uploading and downloading files >2GB works using this patch.
https://github.com/microsoftgraph/msgraph-sdk-java/pull/256 is merged, what is with this one? 😇
Would be awesome if you could merge this and create a new release as soon as possible because currently, uploading files >2GB fails and our user aren't too excited about that 😅.
Hint: To be able to build successfully this project on my machine, I added the following changes from the other PR locally: https://github.com/microsoftgraph/msgraph-sdk-android/pull/87/commits/739e3f1c0755f038205b7bf04d477f686edab4ca