diff --git a/src/Client.php b/src/Client.php index 55bbfd6..d332324 100644 --- a/src/Client.php +++ b/src/Client.php @@ -204,8 +204,8 @@ public function upload(array $options) if (!isset($options['FileContentType'])) { $options['FileContentType'] = 'b2/x-auto'; } - - $response = $this->client->request('POST', $uploadEndpoint, [ + + $body = [ 'headers' => [ 'Authorization' => $uploadAuthToken, 'Content-Type' => $options['FileContentType'], @@ -215,7 +215,15 @@ public function upload(array $options) 'X-Bz-Info-src_last_modified_millis' => $options['FileLastModified'] ], 'body' => $options['Body'] - ]); + ]; + + if (isset($options['FileInfo']) && is_array($options['FileInfo'])) { + foreach($options['FileInfo'] as $key => $value) { + $body['headers']["X-Bz-Info-{$key}"] = $value; + } + } + + $response = $this->client->request('POST', $uploadEndpoint, $body); return new File( $response['fileId'],