PHP File Uploader allows you to select multiple files and upload multiple files at once.
1. Adding Uploader into PHP page and setting MultipleFilesUpload property to true.
-
- <?php require_once "phpuploader/include_phpuploader.php" ?>
- <html>
- <body>
- <form id="form1" method="POST">
- <?php
-
- $uploader=new PhpUploader();
-
- $uploader->Name="myuploader";
-
- $uploader->MultipleFilesUpload=true;
-
- $uploader->Render();
- ?>
- </form>
- </body>
- </html>
|
2. Retrieving all uploaded files.
- <?php
-
- $fileguidlist=@$_POST["myuploader"];
- if($fileguidlist)
- {
- $guidlist=split("/",$fileguidlist);
- foreach($guidlist as $fileguid)
- {
-
-
- $mvcfile=$uploader->GetUploadedFile($fileguid);
- if($mvcfile)
- {
-
- echo($mvcfile->FileName);
-
- echo($mvcfile->FilePath);
-
- echo($mvcfile->FileSize);
-
-
- $mvcfile->CopyTo("/uploads");
-
- $mvcfile->MoveTo("/uploads");
-
- $mvcfile->Delete();
- }
- }
- }
- ?>
|
|
|