From: s-ko Date: Sun, 21 Sep 2014 20:06:36 +0000 (+0100) Subject: Added HTML5 drag&drop upload integration X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c4d7b5750205935cee573fbf7f497d8c8fd7156d;p=simple-upload.git Added HTML5 drag&drop upload integration --- diff --git a/index.php b/index.php index c1ba6c1..133bfcf 100644 --- a/index.php +++ b/index.php @@ -13,16 +13,16 @@ // Name of this file (don't edit) $settings['scriptname'] = pathinfo(__FILE__, PATHINFO_FILENAME) . '.php'; - if (isset($_FILES['fileup']) && strlen($_FILES['fileup']['name']) > 1) { - $upload_file_name = basename($_FILES['fileup']['name']); + if (isset($_FILES['file']) && strlen($_FILES['file']['name']) > 1) { + $upload_file_name = basename($_FILES['file']['name']); $uploadpath = $settings['uploaddir'] . DIRECTORY_SEPARATOR . $upload_file_name; $page_url = $_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['REQUEST_URI']), '\\/'); - if (move_uploaded_file($_FILES['fileup']['tmp_name'], $uploadpath)) { + if (move_uploaded_file($_FILES['file']['tmp_name'], $uploadpath)) { echo 'http://' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['REQUEST_URI']), '\\/') . '/' . $uploadpath; exit; // echo 'File: ' . $upload_file_name . ' successfully uploaded:
'; - // echo 'Size: '. number_format($_FILES['fileup']['size'] / 1024, 3, '.', '') .'KB
'; + // echo 'Size: '. number_format($_FILES['file']['size'] / 1024, 3, '.', '') .'KB
'; // echo 'File /URL: http://'.$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['REQUEST_URI']), '\\/').'/'.$uploadpath.''; } else { echo 'Error: unable to upload the file.'; @@ -33,12 +33,174 @@ Upload <?=$settings['scriptname']?> - + +
- Choose File:
- +
+ Choose File:
+ +
Uploaded files: