PHP Classes

File: upload.php

Recommend this page to a friend!
  Classes of Adeleye Ayodeji   PHP AJAX Image Upload with Progress Bar   upload.php   Download  
File: upload.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: PHP AJAX Image Upload with Progress Bar
Show a progress bar during image file upload
Author: By
Last change:
Date: 1 year ago
Size: 357 bytes
 

Contents

Class file image Download
<?php

//If isset file
if (isset($_FILES)) {
   
$fileName = $_FILES['filename']['name'];
   
//Move uploaded file to a nice directory
   
$targetPath = "uploads/".basename($fileName);
   
$saved = move_uploaded_file($_FILES['filename']['tmp_name'], $targetPath);
    if (
$saved) {
        echo
json_encode(array('info' => 'Uploaded'));
    }
}