Answer the question
In order to leave comments, you need to log in
How to fix File not found at path: C:/OSPanel/userdata/temp/phpB79B.tmp error on OpenServer?
Saving a file in Laravel
public function uploadFile($file)
{
dump($file);
$time = Carbon::now()->toDateTimeString();
$fileName = str_replace(' ', '_', $time . '_' . $file->getClientOriginalName());
$uploadPath = public_path() . DIRECTORY_SEPARATOR . 'upload' . DIRECTORY_SEPARATOR . 'workplacesForm';
// $file->move($uploadPath, $fileName);
Storage::copy($file, $uploadPath . DIRECTORY_SEPARATOR . $fileName);
}
File not found at path: C:/OSPanel/userdata/temp/phpB79B.tmp
UploadedFile {#272
-test: false
-originalName: "eee.txt"
-mimeType: "text/plain"
-size: 0
-error: 0
#hashName: null
path: "C:\OSPanel\userdata\temp"
filename: "phpDCEC.tmp"
basename: "phpDCEC.tmp"
pathname: "C:\OSPanel\userdata\temp\phpDCEC.tmp"
extension: "tmp"
realPath: "C:\OSPanel\userdata\temp\phpDCEC.tmp"
aTime: 2017-09-14 05:48:21
mTime: 2017-09-14 05:48:21
cTime: 2017-09-14 05:48:21
inode: 0
size: 0
perms: 0100666
owner: 0
group: 0
type: "file"
writable: true
readable: true
executable: false
file: true
dir: false
link: false
linkTarget: "C:\OSPanel\userdata\temp\phpDCEC.tmp"
}
Answer the question
In order to leave comments, you need to log in
In short, it's all my own fault:
$time = Carbon::now()->toDateTimeString();
$fileName = str_replace(' ', '_', $time . '_' . $file->getClientOriginalName());
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question