PHP Classes

File: uploady/assets/js/upload.js

Recommend this page to a friend!
  Classes of Faris AL-Otabi   Uploady PHP Upload File to MySQL   uploady/assets/js/upload.js   Download  
File: uploady/assets/js/upload.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Uploady PHP Upload File to MySQL
Store file upload details in a MySQL database
Author: By
Last change: Fixe and Upgrade PhpFileUploading
Added Fallback for Dropzone
Date: 2 months ago
Size: 1,303 bytes


Class file image Download
loadLanguge().then((data) => { let myDropzone = new Dropzone("#my-dropzone", { maxFiles: 10, maxFilesize: document.querySelector("#max_file_size").value, addRemoveLinks: true, dictDefaultMessage: data["drop_files"], dictRemoveFile: data["remove_file"], dictCancelUpload: data["cancel_upload"], }); myDropzone.on("success", function (files, response) { let thumbnail = files.previewElement.querySelector(".dz-filename"); thumbnail.innerHTML = `<span data-dz-name> <a href="${response.downloadlink}">${data["download_file"]}</a> </span>`; let deleteButton = files.previewElement.querySelector(".dz-remove"); deleteButton.addEventListener("click", function (e) { $.ajax({ url: "actions/delete_file.php", type: "POST", data: { file_id: response.file_id, user_id: response.user_id, }, success: function (response) { if (response.status == "success") { files.previewElement.remove(); } }, }); }); }); }); async function loadLanguge() { let lang = document.querySelector("html").getAttribute("lang"); const response = await fetch(`languages/${lang}.json`); const language = await response.json(); return language["general"]; }