2011-11-01 20:05:35 -04:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Upload - Handles uploading files
|
|
|
|
*
|
|
|
|
* Takes an upload request from jquery.filedrop and stores the incoming
|
|
|
|
* files on the server for later viewing.
|
|
|
|
*
|
|
|
|
* @author Andrew Tomaka
|
|
|
|
* @version 1
|
|
|
|
**/
|
|
|
|
|
|
|
|
define('UPLOADS','uploads/');
|
|
|
|
|
2011-11-02 12:53:58 -04:00
|
|
|
if(array_key_exists('image', $_FILES)) {
|
|
|
|
$file = $_FILES['image'];
|
2011-11-01 20:05:35 -04:00
|
|
|
|
|
|
|
move_uploaded_file($file['tmp_name'], UPLOADS . $file['name']);
|
|
|
|
}
|
|
|
|
|
2011-11-02 14:41:40 -04:00
|
|
|
echo json_encode(array('status'=>'Uploaded successfully','file'=>'http://screens.p5dev.com/' . UPLOADS . $file['name']));
|
2011-11-01 20:05:35 -04:00
|
|
|
?>
|