Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

arehman0339's avatar

File uploaded and file name also save into database but file not move to folder. It work fine in localhost but not on hosting.

if($request->hasFile('image')){ $extension=$request->image->extension(); $filename_image=time().".".$extension; $request->image->move(public_path('course\image'),$filename_image); }

0 likes
2 replies
rin4ik's avatar
rin4ik
Best Answer
Level 50

I think this should be

public_path('course/image')

not this

public_path('course\image')
1 like

Please or to participate in this conversation.