File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 3535
3636use GuzzleHttp \Exception \RequestException ;
3737use Icewind \Streams \IteratorDirectory ;
38+ use Icewind \Streams \RetryWrapper ;
3839
3940set_include_path (get_include_path ().PATH_SEPARATOR .
4041 \OC_App::getAppPath ('files_external ' ).'/3rdparty/google-api-php-client/src ' );
@@ -441,10 +442,9 @@ public function fopen($path, $mode) {
441442 // the library's service doesn't support streaming, so we use Guzzle instead
442443 $ client = \OC ::$ server ->getHTTPClientService ()->newClient ();
443444 try {
444- $ tmpFile = \OC ::$ server ->getTempManager ()->getTemporaryFile ($ ext );
445- $ client ->get ($ downloadUrl , [
445+ $ response = $ client ->get ($ downloadUrl , [
446446 'headers ' => $ httpRequest ->getRequestHeaders (),
447- 'save_to ' => $ tmpFile ,
447+ 'stream ' => true
448448 ]);
449449 } catch (RequestException $ e ) {
450450 if (!is_null ($ e ->getResponse ())) {
@@ -458,7 +458,8 @@ public function fopen($path, $mode) {
458458 }
459459 }
460460
461- return fopen ($ tmpFile , 'r ' );
461+ $ handle = $ response ->getBody ();
462+ return RetryWrapper::wrap ($ handle );
462463 }
463464 }
464465 return false ;
You can’t perform that action at this time.
0 commit comments