Dear Friends,
I am trying to upload PDF file(s) through a dynamic upload field . The file name is stored but physical
file is not stored in folder.
my code is
$uploads = $request->file('uploadworkexperience');
foreach ($organizations as $key => $organization) {
$data = [
'app_id' => $app_id,
'exp_organisation' => $organization,
'exp_designation' => $designations[$key],
'exp_job_role' => $jobroles[$key],
'exp_responsibilities' => $responsibilities[$key],
'exp_work_from' => $fromdates[$key],
'exp_work_to' => $todates[$key],
'exp_certificate' => $uploads[$key]->storeAs('public/work_experience', $uploads[$key]->getClientOriginalName(), ['force' => true])
];
DB::table('ksitm_work_experience')->insert($data);
}
$uploads array is like
array:2 [ // app\Http\Controllers\ApplicantController.php:210
0 => Illuminate\Http\UploadedFile {#284
-test: false
-originalName: "sample.pdf"
-mimeType: "application/pdf"
-error: 0
#hashName: null
path: "C:\xampp\tmp"
filename: "php6EDD.tmp"
basename: "php6EDD.tmp"
pathname: "C:\xampp\tmp\php6EDD.tmp"
extension: "tmp"
realPath: "C:\xampp\tmp\php6EDD.tmp"
aTime: 2023-06-12 08:35:08
mTime: 2023-06-12 08:35:07
cTime: 2023-06-12 08:35:07
inode: 32651097298582766
size: 3028
perms: 0100666
owner: 0
group: 0
type: "file"
writable: true
readable: true
executable: false
file: true
dir: false
link: false
linkTarget: "C:\xampp\tmp\php6EDD.tmp"
}
1 => Illuminate\Http\UploadedFile {#285
-test: false
-originalName: "sample.pdf"
-mimeType: "application/pdf"
-error: 0
#hashName: null
path: "C:\xampp\tmp"
filename: "php6EEE.tmp"
basename: "php6EEE.tmp"
pathname: "C:\xampp\tmp\php6EEE.tmp"
extension: "tmp"
realPath: "C:\xampp\tmp\php6EEE.tmp"
aTime: 2023-06-12 08:35:08
mTime: 2023-06-12 08:35:07
cTime: 2023-06-12 08:35:07
inode: 15199648742522281
size: 3028
perms: 0100666
owner: 0
group: 0
type: "file"
writable: true
readable: true
executable: false
file: true
dir: false
link: false
linkTarget: "C:\xampp\tmp\php6EEE.tmp"
}
]
why this happen. I am working in localhost machine .
Thanks
Anes P A