Laravel: The file was not uploaded due to an unknown error

前端 未结 2 597
轮回少年
轮回少年 2021-01-25 12:12

I am trying to upload a file to two different locations. The lcoations being /2x/ adn /3x/. It uploads the file on 3x but doesn\'t on 2x and throws thi

相关标签:
2条回答
  • 2021-01-25 12:38

    You can try this:

    $request->file('photo')->move($destination_path, $file_name);
    

    Add DIRECTORY_SEPARATOR between path and filename if needed and copy that file at new location

    copy($destination_path.$file_name, $new_path.$new_file_name);
    
    0 讨论(0)
  • 2021-01-25 12:39

    Check your code if your file upload code is running two times.

    I was facing the same issue & then I find that my file upload code is running two times.

    after commenting one of them it's working fine.

    0 讨论(0)
提交回复
热议问题