I try this:

$typefile =$request->file('filename')->getMimeType(); $fileName = $uid.'|'.$variant.'|'.$subject.'.'.$typefile; $request->file('filename')->move('upload/', $fileName) 

A file is loaded into the folder, the name of which is the type of this file. And when downloading, it turns out that, for example, the picture became an executable file with the exe extension.

For example:

I send a picture with the extension png.

I do:

  echo $fileName; 

I receive:

 228869386|3|inf.image/png 

And in the folder:

Name: png, type: exe.

    1 answer 1

    In Laravel, you can access a class dynamic property that is consonant with the name id from the query.

     $request->file('filename') 

    You can refer to the methods

     $full_path_w_ext = $request->filename->path(); $just_ext = $request->filename->extension(); 

    Enough to save

     $request->filename->move('upload/', $request->filename->getBasename())