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
  How to Stop Sending E-Mail Spam using PHP mail function Kingsolomon 1 742 11-12-2018, 04:38 PM
Last Post: Solomon
  How to limit text length in php and provide 'Read more' link Kingsolomon 0 684 10-31-2018, 02:08 PM
Last Post: Kingsolomon
  How to read more / hide text using Jquery and PHP Kingsolomon 0 544 10-31-2018, 02:06 PM
Last Post: Kingsolomon
  Download simple HTML email templates Kingsolomon 0 600 10-31-2018, 02:05 PM
Last Post: Kingsolomon
  TIPS How to get Page Loading Time using PHP Kingsolomon 1 631 10-11-2018, 08:29 AM
Last Post: kingugo

Forum Jump:


Users browsing this thread:
1 Guest(s)

Multiple file upload in php00