Current File : /home/users/barii/public_html/finansenl.com.pl/system.fotomagnesy.pl/nowy-uploader2.php |
<?php
session_start();
?>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.9.3/dropzone.min.css" integrity="sha512-jU/7UFiaW5UBGODEopEqnbIAHOI8fO6T99m7Tsmqs2gkdujByJfkCbbfPSN4Wlqlb9TGnsuC0YgUgWkRBK7B9A==" crossorigin="anonymous" referrerpolicy="no-referrer" /> <script src="//code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.9.3/dropzone.min.js" integrity="sha512-U2WE1ktpMTuRBPoCFDzomoIorbOyUv0sP8B+INA3EzNAhehbzED1rOJg6bCqPf/Tuposxb5ja/MAUnC8THSbLQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> <style>
body, html {
overflow: hidden;
font-family: Arial;
}
</style>
</head>
<body>
<div style="padding:30px 10px;text-align:center">
<form action="action.php" class="dropzone box has-advanced-upload" id="my-awesome-dropzone" method="post" enctype="multipart/form-data">
<div class="fallback">
<input name="file" type="file" multiple />
</div>
<div class="progress-bar" id="upload-progress"></div>
<input type="submit" name="submit" value="Upload"/>
</form>
</div>
<script>
Dropzone.options.myAwesomeDropzone = {
paramName: "files", // The name that will be used to transfer the file
maxFilesize: 2, // MB
dictDefaultMessage: "Drop files here to upload",
init: function() {
this.on("sending", function(file, xhr, formData) {
// Show loading spinner or something before the file is sent
document.querySelector(".progress-bar").style.width = "0%";
});
this.on("uploadprogress", function(file, progress, bytesSent) {
// Update the progress bar during the upload
document.querySelector(".progress-bar").style.width = progress + "%";
});
this.on("success", function(file, response) {
// Handle the responseText here. For example, add the text to the element that displays the uploaded files
// Possibly parse JSON response and update UI
});
this.on("complete", function(file) {
this.removeFile(file);
});
this.on("error", function(file, response) {
// Handle the error
alert("Error: " + response);
});
}
};
</script>
</body>
</html>