Level 2
What exactly happens on the live site?
In my Laravel application i can upload files thru a browser i created. The files go to app/storage/files. This only works localy when I upload the files. But on the live server it doesn't is there anything i need to do on the live server site?
Here is the upload code
public function uploadFile(Request $request){
$file = $request->file('file');
$path="";
$trackCat= $request->header('trackCategory');
switch ($trackCat) {
case 1:
$path="muti";
break;
case 2:
$path="over";
break;
case 3:
$path="pra";
break;
default:
$path="muti";
}
/*Check to see if its a image we are uploading */
$imageMatch=preg_match("/\b(\.jpg|\.JPG|\.png|\.PNG|\.gif|\.GIF)\b/", $file->getClientOriginalName(), $output_array);
if($imageMatch==1){
$file->store('tracks/'.$path.'/images');
}
if($imageMatch==0){
$file->store('tracks/'.$path);
}
/*Return response */
return response()->json([
'filename' => $file->hashName(),
'trackCategory' => $trackCat,
'extension' => $file->getClientOriginalName()
]);
}
Please or to participate in this conversation.