Skip to content

Commit 0d13a3c

Browse files
committed
Contemplate case where filename doesn't have extension
1 parent 13ed28f commit 0d13a3c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Client.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,10 @@ public function upload($path)
565565
'base_uri' => $this->getApiRoot()
566566
]);
567567
$fileinfo = pathinfo($path);
568-
$filename = str_replace('.', '_', $fileinfo['filename']) . '.' . $fileinfo['extension'];
568+
$filename = str_replace('.', '_', $fileinfo['filename']);
569+
if (isset($fileinfo['extension'])) {
570+
$filename .= '.' . $fileinfo['extension'];
571+
}
569572
$options = [
570573
'multipart' => [
571574
[

0 commit comments

Comments
 (0)