File: C:/xampp/htdocs/dropfile/left.php
<?php
session_start();
$_SESSION["favcolor"] = "green";
?>
<!DOCTYPE HTML>
<!--
/*
* jQuery File Upload Plugin Basic Demo
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* https://opensource.org/licenses/MIT
*/
-->
<html lang="zh-tw">
<head>
<!-- Force latest IE rendering engine or ChromeFrame if installed -->
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><![endif]-->
<meta charset="utf-8">
<title>File Upload!</title>
<!-- Bootstrap styles -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<!-- Generic page styles -->
<link rel="stylesheet" href="css/style.css">
<!-- CSS to style the file input field as button and adjust the Bootstrap progress bars -->
<link rel="stylesheet" href="css/jquery.fileupload.css">
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top">
<div class="container">
</div>
</div>
<div class="container">
<h1>檔案上傳 </h1>
<div><?php echo iconv('big5','utf-8',$_SESSION["path"]);?></div>
<br>
<blockquote>
<p>Drag n Drop your data here!</p>
</blockquote>
<br>
<!-- The fileinput-button span is used to style the file input field as button -->
<span class="btn btn-success fileinput-button">
<i class="glyphicon glyphicon-plus"></i>
<span>Select files...</span>
<!-- The file input field used as target for the file upload widget -->
<input id="fileuploaxd" type="file" name="files[]" multiple>
</span>
<br>
<br>
<!-- The global progress bar -->
<div id="progress" class="progress">
<div class="progress-bar progress-bar-success"></div>
</div>
<!-- The container for the uploaded files -->
<div> <input type ="button" onclick="javascript:location.href='left.php'" value="reset list"></input></div>
<br>
<div>
<form action="mkdir.php" method="post" enctype="multipart/form-data">
<tr>
<td valign="top"><b><font size="-1">檔案夾: </font></b>
<input size="15" maxlength="50" type="text" name="ddir"></td>
<td><input type="submit" name="submit" value="set dir"></td>
</tr>
</form>
</div>
<br>
<div id="files" class="files"></div>
<br>
</div>
<script src="js/jquery.min.js"></script>
<!-- The jQuery UI widget factory, can be omitted if jQuery UI is already included -->
<script src="js/vendor/jquery.ui.widget.js"></script>
<!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
<script src="js/jquery.iframe-transport.js"></script>
<!-- The basic File Upload plugin -->
<script src="js/jquery.fileupload.js"></script>
<script>
</script>
<script>
/*jslint unparam: true */
/*global window, $ */
$(function () {
'use strict';
//var holder = document.getElementById('holder'),
// Change this to the location of your server-side upload handler:
//var iconv = require('iconv-lite');
var url = window.location.hostname === 'blueimp.github.io' ?
'//jquery-file-upload.appspot.com/' : 'php/';
$('#fileuploaxd').fileupload({
url: url,
dataType: 'json',
//encoding: 'big5',
done: function (e, data) {
$.each(data.result.files, function (index, file) {
$('<p/>').text(decodeURI(file.name)).appendTo('#files');
});
//window.open("http://127.0.0.1/cmykDe/6pmmTVI-parsingCTOKXg.php?f123=target.txt&f321=upload/DE_Paperx.txt","_self")
},
progressall: function (e, data) {
var progress = parseInt(data.loaded / data.total * 100, 10);
$('#progress .progress-bar').css(
'width',
progress + '%'
//window.open("http://127.0.0.1/cmykDe","_self")
);
//window.open("http://127.0.0.1/cmykDe/6pmmTVI-parsingCTOKXg.php?f123=target.txt&f321=/php/upload/DE_Cyanx.txt","_self")
//holder.innerHTML += '<p>Uploaded x ' + file.name;
//alert ('<p>Uploaded x ') ;
//alert ('here 105') ;
}
}).prop('disabled', !$.support.fileInput)
.parent().addClass($.support.fileInput ? undefined : 'disabled');
//alert ('here 109') ;
});
</script>
</body>
</html>