Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multiple file upload in php
#1
Sometimes we need to allow our users to upload multiple file upload. Today I am going to show you how to allow users to upload multiple files. It is almost similar like simple file upload but we need to do some modification with html markup and php code. Now I am going to show you how to upload multiple file with PHP and basic HTML form.


Code:
for($i=0; $i<count($_FILES['file']['name']); $i++) {

   $tmpFilePath = $_FILES['file']['tmp_name'][$i];
   $shortname = $_FILES['file']['name'][$i];
   $filename = date('YmdHis').$_FILES['file']['name'][$i];
   $filePath = "./public/course_work/".$filename;
   $ext = pathinfo($_FILES['file']['name'][$i], PATHINFO_EXTENSION);

   $file = basename($shortname,".".$ext);


   if(move_uploaded_file($tmpFilePath, $filePath))
   {
       
   }
}
To Purchase Credit Click here , For how to make money on Sologet forum Click here 

HIRE ME FOR WEBSITE DESIGNING USE THE PM BUTTON TO SEND ME MESSAGE

There is love in sharing
  


Messages In This Thread
Multiple file upload in php - by Kingsolomon - 10-31-2018, 02:19 PM
RE: Multiple file upload in php - by Solomon - 11-08-2018, 03:01 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  TIPS How to add one day in current date using php Kingsolomon 1 859 04-14-2020, 01:16 AM
Last Post: Shugudun
  How to session timeout warning with countdown using PHP, Ajax and HTML Kingsolomon 1 856 04-14-2020, 01:10 AM
Last Post: Shugudun
  TIPS How to get Page Loading Time using PHP Kingsolomon 2 1,009 04-14-2020, 01:01 AM
Last Post: Shugudun
  How to read more / hide text using Jquery and PHP Kingsolomon 1 881 04-14-2020, 12:57 AM
Last Post: Shugudun
  How to limit text length in php and provide 'Read more' link Kingsolomon 1 1,075 04-14-2020, 12:43 AM
Last Post: Shugudun

Forum Jump:


Users browsing this thread:
1 Guest(s)

Multiple file upload in php00