PHP File Uploader is 100% HTML and JavaScript code on the client, and PHP code on the server, and can be setup on your web server in just 5 minutes,
simply by following this setup guide.
1. Deploying Uploader Client files.
The "phpuploader" folder and all file it contains (located in the archive) should be deployed to http://{your site}/{your application}/phpuploader/ on your web site.
|
2. Adding Uploader into PHP page.
-
- <?php require_once "phpuploader/include_phpuploader.php" ?>
- <html>
- <body>
- <form id="form1" method="POST">
- <?php
-
- $uploader=new PhpUploader();
-
- $uploader->Name="myuploader";
-
- $uploader->Render();
- ?>
- </form>
- </body>
- </html>
|
3. Retrieving uploaded file.
- <?php
-
- $fileguid=@$_POST["myuploader"];
- if($fileguid)
- {
-
- $mvcfile=$uploader->GetUploadedFile($fileguid);
- if($mvcfile)
- {
-
- echo($mvcfile->FileName);
-
- echo($mvcfile->FilePath);
-
- echo($mvcfile->FileSize);
-
-
- $mvcfile->CopyTo("/uploads");
-
- $mvcfile->MoveTo("/uploads");
-
- $mvcfile->Delete();
- }
- }
- ?>
|
|
|