Search
 
SCRIPT & CODE EXAMPLE
 

PHP

Call to a member function move() on string

if ($request->hasFile('file')) {
    $destinationPath = 'path/th/save/file/';
    $files = $request->file('file'); // will get all files

    foreach ($files as $file) {//this statement will loop through all files.
        $file_name = $file->getClientOriginalName(); //Get file original name
        $file->move($destinationPath , $file_name); // move files to destination folder
    }
}
Comment

PREVIOUS NEXT
Code Example
Php :: get specific columns using with() function in laravel eloquent 
Php :: get current authenticated user laravel 
Php :: php is_int 
Php :: wp get attachment id 
Php :: PHP str_split — Convert a string to an array 
Php :: change field name in validation laravel 8 
Php :: laravel pagination vuetify 
Php :: foreach ph 
Php :: laravel return response view 
Php :: display image in php from folder 
Php :: abort in laravel 
Php :: array intersect 
Php :: lDownload multiple files as a zip-file using php 
Php :: laravel collection toQuery 
Php :: multi condition inside single if in php 
Php :: string and number laravel faker 
Php :: Diferencia entre dias PHP 
Php :: foreach loop in laravel 
Php :: laravel foreign 
Php :: laravel make model along with its controller and migration file 
Php :: php get last digit of number 
Php :: laravel set field unique 
Php :: php description limit 
Php :: create multiple session in php 
Php :: model hasmany laravel 
Php :: laravel @disabled in laravel-9 
Php :: laravel search 
Php :: while true php 
Php :: laravel echo html 
Php :: unique key value array php 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =