Skip to content
Snippets Groups Projects
Unverified Commit 40293052 authored by Roeland Jago Douma's avatar Roeland Jago Douma Committed by GitHub
Browse files

Merge pull request #15168 from nextcloud/fix/13554/always_tmpfile_for_swift

Always use a temp file for swift writes
parents 201fc9fb dedb84ac
No related branches found
No related tags found
No related merge requests found
......@@ -76,14 +76,9 @@ class Swift implements IObjectStore {
* @throws \Exception from openstack lib when something goes wrong
*/
public function writeObject($urn, $stream) {
$handle = $stream;
$meta = stream_get_meta_data($stream);
if (!(isset($meta['seekable']) && $meta['seekable'] === true)) {
$tmpFile = \OC::$server->getTempManager()->getTemporaryFile('swiftwrite');
file_put_contents($tmpFile, $stream);
$handle = fopen($tmpFile, 'rb');
}
$tmpFile = \OC::$server->getTempManager()->getTemporaryFile('swiftwrite');
file_put_contents($tmpFile, $stream);
$handle = fopen($tmpFile, 'rb');
$this->getContainer()->createObject([
'name' => $urn,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment