MiX1.TK
Site menu
Login form
Section categories
Web Development [20]
Learn about PHP & Web Development
Education [4]
Learn for Free
Knowledge & Tricks [0]
General Knowledge,computer Knowledge & tricks
Writing World [2]
A MiX World of SmS on Various Topics
Search
Main » 2012 » November » 6 » Multiple File Upload without using any external plugin
10:07 PM
Multiple File Upload without using any external plugin
hello friends first of all we want to share a example of single file upload in php script after that the second option is Multiple file upload without using any external library like swf upload and flashuploads etc....


Example 1) single file upload , make a anything.php and paste it in ur project and run it and with parallel of this file  , make a folder named
uploads where your files will be upload

<?php

if($_REQUEST)
{
 
 
    move_uploaded_file($_FILES['myfiles']['tmp_name'][$i],"uploads/".$$_FILES['myfiles']['name']);
 
 
    echo '<script>alert("file uploaded  successfully ")</script>';

}
?>
<html>
<head></head>
<body>
<form method="post" enctype="multipart/form-data">
<h1>Single File Upload DEMO</h1>
<span>
select multiple file by holding CTRL key
</span>
<input type="file" name="myfiles" />
<input type="submit" name="submit" value="UPLOAD" />
</body>
</html>



Example 2) Multiple file upload , make a anything.php and paste following code in ur project and run it and with parallel of this file  , make a folder named
uploads where your files will be upload


<?php

if($_REQUEST)
{
  foreach($_FILES['myfiles']['name'] as $i => $name)
  {
 
    move_uploaded_file($_FILES['myfiles']['tmp_name'][$i],"uploads/".$name);
  }
 
    echo '<script>alert("file uploading done successfully ")</script>';

}
?>
<html>
<head></head>
<body>
<form method="post" enctype="multipart/form-data">
<h1>Multiple File Upload </h1>
<span>
select multiple file by holding CTRL key
</span>
<input type="file" multiple="multiple" name="myfiles[]" />
<input type="submit" name="submit" value="UPLOAD" />
</body>
</html>
Category: Web Development | Views: 78 | Added by: admin-priyank | Rating: 5.0/1
Total comments: 0
Name *:
Email *:
Code *:
Calendar
«  November 2012  »
SuMoTuWeThFrSa
    123
45678910
11121314151617
18192021222324
252627282930
Entries archive
Our poll
Rate my site
Total of answers: 4
Site friends
  • Create a free website
  • Online Desktop
  • Free Online Games
  • Video Tutorials
  • All HTML Tags
  • Browser Kits
  • Statistics

    Total online: 1
    Guests: 1
    Users: 0
    Creative Commons License
    Free Downloads and Services by MiX1 is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License
    Copyright MyCorp © 2018