Edit D:\AVA\AVAStandard\AVA.ResourcesPlatform.WebUI\Test\TestUpload.aspx
??<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestUpload.aspx.cs" Inherits="AVA.ResourcesPlatform.WebUI.Test.TestUpload" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title></title> <%= Import.CSS("js", "/JQueryUI/css/redmond/jquery-ui-1.8.9.custom.css")%> <%= Import.ScriptTheme("js/jquery.1.9.js")%> <%= Import.Script("/URL/jquery.url.js")%> <%= Import.Script("/JsonCookie/json2.js")%> <%= Import.Script("/JsonCookie/jquery.cookie.js")%> <%= Import.Script("/JsonCookie/jquery.jsoncookie.js")%> <%= Import.ScriptTheme("js/jquery-ui.min.js")%> <%= Import.Script("js", "/YK_Validate/YK_Validate.js")%> <%= Import.Script("js", "/YK_Validate/YK_ValidateRegex.js")%> <%= Import.CSS("js", "/YK_Validate/validator.css")%> <%= Import.Script("/global.aspx")%> <%= Import.Script("js", "/global.js")%> <%= Import.CSS("Carousel.css")%> </head> <body> <div id="fileselector"> <div id="containerback"> </div> <div id="dirlijst"> </div> <div id=""> <br /> <form name="form1" onSubmit="return false;" method="post" action="/upload" enctype="multipart/form-data"> <div id="progressNumber"></div> <input type="file" id="file" multiple name="uploads[]" style="visibility:hidden" onChange="uploadchange();"> <a href="#" onClick="document.getElementById('file').click();return false"><img src="<%= Request.WebPath()+"/Tools/AnotherUploadify/upload.png" %>" /></a> <div id="uploadlist"> </div> </form> </div> </div> <script> function uploadchange() { var input = document.getElementById("file"); var ul = document.getElementById("uploadlist"); while (ul.hasChildNodes()) { ul.removeChild(ul.firstChild); } for (var i = 0; i < input.files.length; i++) { var li = document.createElement("li"); thefilesize = input.files[i].fileSize || input.files[i].size; if (thefilesize > 1024 * 1024) { thefilesize = (Math.round(thefilesize * 100 / (1024 * 1024)) / 100).toString() + 'MB'; } else { thefilesize = (Math.round(thefilesize * 100 / 1024) / 100).toString() + 'KB'; } li.innerHTML = input.files[i].name + " " + thefilesize; ul.appendChild(li); } if (!ul.hasChildNodes()) { var li = document.createElement("li"); li.innerHTML = 'No Files Selected'; ul.appendChild(li); } var xhr = new XMLHttpRequest(); xhr.open("GET", "./file"); xhr.onload = function (e) { console.log(e); } sendRequest(); } // ie??9 ???HTML5 blob window.BlobBuilder = window.MozBlobBuilder || window.WebKitBlobBuilder || window.BlobBuilder; function sendRequest(filestat) { var file = filestat || { start: 0 }; var blob = document.getElementById('file').files[0]; var BYTES_PER_CHUNK = 1048576; // 1MB chunk sizes.??????1M var SIZE = blob.size; var start = file.start; var end = BYTES_PER_CHUNK; window.uploadcounter = 0; window.uploadfilearray = []; document.getElementById('progressNumber').innerHTML = "Upload: 0 % "; while (start < SIZE) { var chunk = blob.slice(start, end); window.uploadfilearray[window.uploadcounter] = chunk; window.uploadcounter = window.uploadcounter + 1; start = end; end = start + BYTES_PER_CHUNK; } window.uploadcounter = 0; //???????? uploadFile(window.uploadfilearray[window.uploadcounter], document.getElementById('file').files[0]); } function fileSelected() { var file = document.getElementById('fileToUpload').files[0]; if (file) { var fileSize = 0; if (file.size > 1024 * 1024) fileSize = (Math.round(file.size * 100 / (1024 * 1024)) / 100).toString() + 'MB'; else fileSize = (Math.round(file.size * 100 / 1024) / 100).toString() + 'KB'; document.getElementById('fileName').innerHTML = 'Name: ' + file.name; document.getElementById('fileSize').innerHTML = 'Size: ' + fileSize; document.getElementById('fileType').innerHTML = 'Type: ' + file.type; } } function uploadFile(blobFile, file) { var filename = file.name; filename = encodeURIComponent(filename); var filesize = file.size; var fd = new FormData(); fd.append("fileToUpload", blobFile); var xhr = new XMLHttpRequest(); xhr.addEventListener("load", uploadComplete, false); xhr.addEventListener("error", uploadFailed, false); xhr.addEventListener("abort", uploadCanceled, false); xhr.open("POST", "/Test/TestUpload.aspx?FileName=" + filename + "&FileSize=" + filesize); xhr.onload = function (e) { window.uploadcounter = window.uploadcounter + 1; if (window.uploadfilearray.length > window.uploadcounter) { // ?????? ???loop??? uploadFile(window.uploadfilearray[window.uploadcounter], document.getElementById('file').files[0]); var percentloaded2 = parseInt((window.uploadcounter / window.uploadfilearray.length) * 100); document.getElementById('progressNumber').innerHTML = '??????: ' + percentloaded2 + ' % '; } else { document.getElementById('progressNumber').innerHTML = "??????"; // loadXMLDoc('./system/loaddir.php?url='+ window.currentuploaddir); } }; xhr.send(fd); } function uploadComplete(evt) { //??????????????????????????alert????""??????????????? /* This event is raised when the server send back a response */ //if (evt.target.responseText != "") { // alert(evt.target.responseText); //} } function uploadFailed(evt) { alert("There was an error attempting to upload the file."); } function uploadCanceled(evt) { xhr.abort(); xhr = null; //alert("The upload has been canceled by the user or the browser dropped the connection."); } </script> <%--<p>Server side ?????: <br /> <code> // ?????? app.get('/file', function(req,res){ var fieldname = "fileToUpload"; var saveToWhere = path.join(__dirname + '/public/', path.basename(fieldname)); if( fs.existsSync(saveToWhere)){ var stats = fs.lstatSync(saveToWhere); return res.json(stats); } res.status(404).end(); }); // ?????? app.post('/upload',function(req,res) { var filesize = req.query.filesize; var busboy = new Busboy( { headers: req.headers , limits:{ // fileSize: } }); busboy.on('file', function(fieldname, file,filename, encoding, mimetype){ var saveToWhere = path.join(__dirname + '/public/', path.basename(fieldname)); if( fs.existsSync(saveToWhere)){ // ????????? ????????? ?????? var stats = fs.lstatSync(saveToWhere); if(filesize){ if(stats.size < filesize){ file.pipe(fs.createWriteStream(saveToWhere, {start:stats.size })); } } }else{ file.pipe(fs.createWriteStream(saveToWhere)); } }); busboy.on("finish", function(){ res.send("ok"); }) req.pipe(busboy); });</code> </p>--%> <br /> <br /> <br /> <br /> <br /> <hr class="hr-dashed" /> <h1>???????????</h1> <!-- flash via FTP or HTTP--> <style type="text/css" media="screen"> object:focus { outline:none; } #flashContent { display:none; } </style> <style> .iItemList,.iItemName,.iItemSize,.iItemSuccess,.iItemFail,.iItemloading{font-style:normal;margin-right:15px;} .iItemSuccess{display:none;} .iItemFail{display:none;} li{list-style:none;} .progress{height:3px;width:100%;background:#ccc;} .speed{height:3px;width:0;background:#19a97b;} .topToop{position:relative;font-size:14px;line-height:24px;padding:3px 10px;} .deleteNode{display:inline-block;*zoom:1;width:16px;height:16px;position:absolute;top:7px;right:10px;background:url('cancel.png') no-repeat;cursor:pointer;} </style> <script> function thisMovie(movieName) { if (navigator.appName.indexOf("Mi0crosoft") != -1) { return window[movieName]; } else { return document[movieName]; } } function deleteItem(index) { var liWrap = dom("li_" + index); if (liWrap.getAttribute('rel')) { return false; } else { liWrap.setAttribute('rel', '1'); thisMovie("AnotherUploadify").fl_delete(index); } } function createElement(tag) { return document.createElement(tag); } function ISObject(data) { return Object.prototype.toString.call(data) == '[object Object]'; } function stringToJSON(data) { if (!ISObject(data)) { data = eval('(' + data + ')'); } return data; } function dom(id) { return document.getElementById(id); } function isIE() { var ua = navigator.userAgent.toLowerCase(); var ie = /msie/; return ie.test(ua); } function setOpacity(id) { var opacity = 100; var el = dom('li_' + id); function fn() { opa = (function () { return opacity = opacity - 10 })(); if (opa < 0) { dom('wrapper').removeChild(el); clearInterval(flag); return; } if (isIE) { el.style.filter = "alpha(opacity=" + opa + ")"; } else { el.style.opacity = (opacity / 100); } } var flag = setInterval(fn, 50); } function js_select(data) { var elem, fragment, li, ul, wrapper; if (wrapper = dom('wrapper')) { wrapper.parentNode.removeChild(wrapper); } data = stringToJSON(data); elem = document.body; fragment = document.createDocumentFragment('ul'); ul = createElement('ul'); ul.id = 'wrapper'; if (Object.prototype.toString.call(data) == '[object Array]') { for (var i = 0; i < data.length; i++) { if (Object.prototype.toString.call(data[i]) == '[object Object]') { li = createElement('li'); li.id = "li_" + data[i].index; li.innerHTML = '<div class="topToop"><b class="iItemList">' + data[i].index + '</b><i class="iItemName">' + data[i].name + '</i><i class="iItemSize">' + data[i].size + '</i> - <i class="iItemloading" id="memoryProgress_' + data[i].index + '">(0)</i><i class="deleteNode" id="' + data[i].index + '" onclick="deleteItem(this.id)"></i></div><div id="progress_' + data[i].index + '" class="progress"><div id=speed_' + data[i].index + ' class="speed"></div></div>'; fragment.appendChild(li); } else { continue; } } } else { return; } ul.appendChild(fragment); elem.appendChild(ul); } function js_upload2ServerProgress(data) { data = stringToJSON(data); var speed = dom('speed_' + data.index); speed.style.width = (data.progress) + '%'; dom('memoryProgress_' + data.index).innerHTML = '(' + data.progress + '%)'; } function js_upload2ServerComplete(data) { data = stringToJSON(data); setOpacity(data.index) } function js_uploadIOError(data) { data = stringToJSON(data); var errorStatus = dom('statusError_' + data.index); errorStatus.style.display = "inline-block"; } function js_load2MemoryProgress(data) { data = stringToJSON(data); dom('memoryProgress_' + data.index).innerHTML = '(?????...' + data.progress + '%)'; } function js_deleteItemOK(data) { data = stringToJSON(data); setOpacity(data.index); } </script> <script type="text/javascript"> $(function () { // For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. var swfVersionStr = "11.1.0"; // To use express install, set to playerProductInstall.swf, otherwise the empty string. var xiSwfUrlStr = ""; var flashvars = {}; flashvars.selectBtnImgUrl = "<%= Request.WebPath()+"/Tools/AnotherUploadify/upload.png" %>"; //???????? ???????? ??ttp //flashvars.protocol = "http"; //flashvars.url = ""; //??????????? ??tp /* ''' as3???socket?????????????????????843?????????????? ''' import sys import socket import threading if len(sys.argv) == 1: print 'please input server ip' sys.exit() host = sys.argv[1] s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind((host, 843)) s.listen(0) print 'waiting for connection ' def tcplink(sock, addr): print 'Accept new connection from %s:%s' % addr sock.send('<cross-domain-policy><site-control permitted-cross-domain-policies="all"/><allow-access-from domain="*" to-ports="*"/></cross-domain-policy>') sock.close() while True: sock, addr = s.accept() t = threading.Thread(target=tcplink, args=(sock, addr)) t.start() */ flashvars.protocol = "ftp"; flashvars.developermode = "true"; flashvars.host = "localhost"; flashvars.port = "80"; flashvars.url = "/Test/TestUploadImg.aspx"; flashvars.user = "webftp"; flashvars.pass = "webftp"; flashvars.description = "jpg??????????p3???"; flashvars.extension = "*.jpg;*.mp3"; flashvars.chunkSize = "65536"; //???socket??????????????????????yte,?????64KB flashvars.interval = "100"; //?????????????????????? flashvars.field = "Filedata"; var params = {}; params.quality = "high"; params.bgcolor = "#ffffff"; params.allowscriptaccess = "always"; params.allowfullscreen = "true"; var attributes = {}; attributes.id = "AnotherUploadify"; attributes.name = "AnotherUploadify"; attributes.align = "middle"; swfobject.embedSWF( "<%= Request.WebPath()+"/Tools/AnotherUploadify/AnotherUploadify.swf"%>", "flashContent", "140", "40", swfVersionStr, xiSwfUrlStr, flashvars, params, attributes); // JavaScript enabled so display the flashContent div in case it is not replaced with a swf object. swfobject.createCSS("#flashContent", "display:block;text-align:left;"); }) </script> <!-- SWFObject's dynamic embed method replaces this alternative HTML content with Flash content when enough JavaScript and Flash plug-in support is available. The div is initially hidden so that it doesn't show when JavaScript is disabled. --> <div id="flashContent"> <p> To view this page ensure that Adobe Flash Player version 11.1.0 or greater is installed. </p> <script type="text/javascript"> var pageHost = ((document.location.protocol == "https:") ? "https://" : "http://"); document.write("<a href='http://www.adobe.com/go/getflashplayer'><img src='" + pageHost + "www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a>"); </script> </div> </div> <%= Import.ScriptTheme("assets/app.js") %> <%= Import.ScriptTheme("assets/theme.js") %> </body> </html>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de