2020年12月31日星期四

file upload a pdf in laravel

Hi everyone i need some help i work a program called file upload , but i dont get it what happen to the file i upload in laravel. in public folder there's a name called php4CA1.tmp every time i upload a pdf file please can anybody help me ? what is the meaning of this php4CA1.tmp or my code is wrong?

    $request->validate([          'cover' => 'required',          'book' => 'required',          'name' => 'required',          'description' => 'required',          'price' => 'required|numeric'      ]);        $image = $request->file('cover');      $new_name = rand() . '.' . $image->getClientOriginalExtension();      $image->move(public_path('images'),$new_name);        $book = $request->file('book');      $new_book_name = rand() . '.' . $book->getClientOriginalExtension();      $book->move(public_path('books'),$book);        $data = array(          'cover' => $new_name,          'book' => $new_book_name,          'name' => $request->name,          'description' => $request->description,          'price' => $request->price      );      Book::create($data);  

Here is the file upload in laravel

https://stackoverflow.com/questions/65526837/file-upload-a-pdf-in-laravel January 01, 2021 at 10:04AM

没有评论:

发表评论