-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Copy into local file #22604
Copy into local file #22604
Conversation
Alternatively we need to get somehow a proper stream there that will be read properly 🙊 |
@icewind1991 Do you know why the streaming stuff behaves wrongly as described at #22590 (comment)? You added that code at #18653 |
@LukasReschke are you sure this fills memory ? I don't think so, it would just stream copy the contents to the target. If in doubt you can also use the Util class's Not sure if related, but the stream wrapper code lies about being seekable, see #22476. We could try fixing the stream wrapper first. If that doesn't work, then we'll merge @LukasReschke's fix which is still better than the original code from v8.2.2. |
Somehow I don't manage to get this working here 🙈 |
While wanting to test this against the DAV backend, it turns out: This one is at the moment completely broken, at least against other ownClouds. |
If you say streamCopy didn't work, maybe it's because it also uses |
👍 |
CC @schiesbn |
Use |
Good point. We can't use sink directly here since that does not exist in our version of Guzzle but |
Using the Guzzle stream directly here will only return 1739 characters for `fread` instead of all data. This leads to the problem that the stream is read incorrectly and thus the data cannot be properly decrypted => 💣 This approach copies the data into a local temporary file, as done before in all stable releases as well as other storage connectors. While this approach will load the whole file into memory, this is already was has happened before in any stable release as well. See d608c37 for the breaking change. To test this enable Google Drive as external storage and upload some files with encryption enabled. Reading the file should fail now. Fixes #22590
Adjusted. |
44f4935
to
3b5ddb4
Compare
Doesn't seem to work:
|
That's actually unrelated and caused by the fact that I defined the proper use statement. The exception code path was NEVER called before. Let me add some more debugging code to this. |
Works now 👍 |
Second review please @icewind1991 @Xenopathic @davitol |
Code looks good 👍 |
WFM 👍 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Using the Guzzle stream directly here will only return 1739 characters for
fread
instead of all data. This leads to the problem that the stream is read incorrectly and thus the data cannot be properly decrypted => 💣(see #22590 (comment) for more context)
This approach copies the data into a local temporary file, as done before in all stable releases as well as other storage connectors.
While this approach will load the whole file into memory, this is already was has happened before in any stable release as well. See d608c37 for the breaking change. I believe for 9.0 we should keep it like that.
To test this enable Google Drive as external storage and upload some files with encryption enabled. Reading the file should fail now.
Fixes #22590
@PVince81 please test.
@icewind1991 Other ideas?