Laravel File upload issue -


i want upload file in laravel show error like

fileexception in uploadedfile.php line 251: file "april.xlsx" not uploaded due unknown error. 

i use 'files'=>true in form tag. , in controller code is

$mandatorydocument = $input['mandatorydocument']; if($mandatorydocument != null)  {   $mandatoryfile = time().'-'.$mandatorydocument->getclientoriginalname();   $mandatorydocument->move(public_path().'/files/mandatory_documents/',$mandatoryfile);   $achievement->file_path = $mandatoryfile;  } 

when dd($input['mandatorydocument']) in controller get

uploadedfile {#27 ▼ -test: false -originalname: "april.xlsx" -mimetype: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" -size: 12297 -error: 0 } , file moved in /public/files/mandatory_documents error. why error come. problem? thank you.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -