diff --git a/dragndrop.html b/dragndrop.html index 1e249c4..a58a14e 100644 --- a/dragndrop.html +++ b/dragndrop.html @@ -18,11 +18,14 @@ -
+

Your browser doesn't have Flash, Silverlight or HTML5 support.


+
+ +
@@ -83,7 +86,17 @@ prevent_duplicates: true, - autostart: true + autostart: true, + + init: { + 'FileUploaded': function(up, file, info) { + var obj = JSON.parse(info.response); + //console.log(obj); + //console.log(obj.cleanFileName); + document.getElementById('filelist').innerHTML += ''; + } + + } }); diff --git a/dump.php b/dump.php index 3ce4471..9525087 100755 --- a/dump.php +++ b/dump.php @@ -10,7 +10,7 @@

Shows the form items posted.

- +
@@ -18,7 +18,17 @@ $value) { ?> + + + '; + ?> +
Name Value
diff --git a/upload.php b/upload.php index 52abc19..4bb6579 100755 --- a/upload.php +++ b/upload.php @@ -35,7 +35,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') { @set_time_limit(5 * 60); // Uncomment this one to fake upload time -// usleep(5000); + usleep(5000); // Settings //$targetDir = ini_get("upload_tmp_dir") . DIRECTORY_SEPARATOR . "plupload"; @@ -59,7 +59,10 @@ if (isset($_REQUEST["name"])) { $fileName = uniqid("file_"); } -$filePath = $targetDir . DIRECTORY_SEPARATOR . $fileName . date("YmdHis"); +// change file name if you want to here +$fileName = date("YmdHis") . '_' . $fileName; + +$filePath = $targetDir . DIRECTORY_SEPARATOR . $fileName; // Chunking might be enabled $chunk = isset($_REQUEST["chunk"]) ? intval($_REQUEST["chunk"]) : 0; @@ -86,7 +89,7 @@ if ($cleanupTargetDir) { } } closedir($dir); -} +} // Open temp file @@ -123,4 +126,4 @@ if (!$chunks || $chunk == $chunks - 1) { } // Return Success JSON-RPC response -die('{"jsonrpc" : "2.0", "result" : null, "id" : "id"}'); +die('{"jsonrpc" : "2.0", "result" : null, "id" : "id", "cleanFileName" : "'.$fileName.'"}'); -- libgit2 0.21.2