It uses the upload component of iview, and the backend uses laravel to get the uploaded image.

the front end uses the upload component of iview to upload pictures, and the back end uses laravel5.6 to upload pictures. It is found that the picture content is empty using $request- > all () , as shown in the following figure

.



$_FILES

I don"t know what the problem is. Now I need to use $request- > file ("avatar") to get it. How can I solve it?


print $request- > headers to see what Content-Type is, usually when Content-Type is wrong.


the problem certainly doesn't lie in iview, because I've tried it with iview. Php can get pictures natively, using $_ FILES

but I didn't try it with laravel5.6.
the problem should lie in the use of your laravel5.6. There must be something wrong with the posture. I suggest you take a good look at the document. I haven't used this framework to help you eliminate the front-end problems. I can only help you so far.


isn't the backend supposed to be $req- > file ('avatar') ?


clipboard.png
official documents don't say you can use $request- > all () to get uploaded files

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b33e9a-3429b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b33e9a-3429b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?