We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 6d79c25 + 738844e commit 2befe6dCopy full SHA for 2befe6d
src/Client.php
@@ -564,11 +564,16 @@ public function upload($path)
564
$guzzle = new GuzzleClient([
565
'base_uri' => $this->getApiRoot()
566
]);
567
+ $fileinfo = pathinfo($path);
568
+ $filename = preg_replace('/\W+/', '_', $fileinfo['filename']);
569
+ if (isset($fileinfo['extension'])) {
570
+ $filename .= '.' . $fileinfo['extension'];
571
+ }
572
$options = [
573
'multipart' => [
574
[
- 'name' => basename($path),
- 'filename' => basename($path),
575
+ 'name' => 'source',
576
+ 'filename' => $filename,
577
'contents' => fopen($path, 'r')
578
]
579
],
0 commit comments