Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multiple file upload in php
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.

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 . 
There is love in sharing
Nice share

Possibly Related Threads...
Thread Author Replies Views Last Post
  How to Stop Sending E-Mail Spam using PHP mail function Kingsolomon 1 56 11-12-2018, 04:38 PM
Last Post: Solomon
  How to limit text length in php and provide 'Read more' link Kingsolomon 0 46 10-31-2018, 02:08 PM
Last Post: Kingsolomon
  How to read more / hide text using Jquery and PHP Kingsolomon 0 39 10-31-2018, 02:06 PM
Last Post: Kingsolomon
  Download simple HTML email templates Kingsolomon 0 41 10-31-2018, 02:05 PM
Last Post: Kingsolomon
  TIPS How to get Page Loading Time using PHP Kingsolomon 1 74 10-11-2018, 08:29 AM
Last Post: kingugo

Forum Jump:

Users browsing this thread:
1 Guest(s)

Users that viewed this thread:
1 User(s) read this thread:
Multiple file upload in php00