Skip to content

Commit

Permalink
Merge pull request #10 from alexanderglueck/master
Browse files Browse the repository at this point in the history
Fix chunked upload error
  • Loading branch information
Jusdon authored Oct 5, 2023
2 parents abce479 + 204391c commit 948890b
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/OneDriveAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,10 @@ private function writeChunk(Http $http, string $upload_url, int $file_size, stri
'Content-Length' => strlen($chunk),
];

$response = $http->put(
$upload_url,
[
'headers' => $headers,
'body' => $chunk,
'timeout' => $this->options['request_timeout'],
]
);
$response = $http::withHeaders($headers)
->withBody($chunk,'application/octet-stream')
->timeout($this->options['request_timeout'])
->put($upload_url);

if ($response->status() === 404) {
throw new Exception('Upload URL has expired, please create new upload session');
Expand Down

0 comments on commit 948890b

Please sign in to comment.