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.
1 parent cdfd759 commit 3133a22Copy full SHA for 3133a22
src/Handlers/Uploader.php
@@ -325,6 +325,12 @@ public function process($field = null)
325
326
$targetPath = $this->path;
327
328
+ if ( ! is_writable($targetPath)) {
329
+ if ( ! file_exists($targetPath)) {
330
+ mkdir($targetPath, 0777, true);
331
+ }
332
333
+
334
if (empty($this->targetFilename)) {
335
$this->setTargetFilename($file->getClientFilename());
336
}
@@ -448,7 +454,8 @@ protected function validate(UploadFile $file)
448
454
protected function move(UploadFile $file, $targetPath)
449
455
{
450
456
$fileInfo = [
451
- 'name' => $file->getClientFilename(),
457
+ 'name' => pathinfo($targetPath, PATHINFO_BASENAME),
458
+ 'path' => $targetPath,
452
459
'mime' => $file->getFileMime(),
453
460
'size' => $file->getSize()
461
];
0 commit comments