I'm trying to upload a video and I get the path stored correctly in my database but I don't get the video in the folder that I want.
Here is my code:
$postvideo = Postmedia::where('post_id',$id)->where('type','video')->first();
if (isset($postvideo))
{
if ($request->video_link) {
$postvideo->path = $request->video_link;
$postvideo->typevid = $request->link;
}
else
{
File::delete($postvideo->path);
if($request->hasFile('video_link_local'))
{
$file = $request->file('video_link_local');
$filename = $file->getClientOriginalName();
$path = 'uploads/post/';
$file->move($path, $filename);
$postvideo->path = $path.$filename;
$postvideo->ext = ($request->video_link_local)->getClientOriginalExtension();
$postvideo->typevid = $request->local;
}
}
$postvideo->save();
}
the upload now works but in the case of accentuated filenames i get a problem in this line the name of the file is changed
$file->move($path, $filename);
like this for example : Présentation -> Présentation !!! So this creates a problem when i want to show the uploaded video