File manager - Edit - /home/gzbnyc5/pty-app/realstate/public/js/pty.v2.file.upload.js
Back
const PtyFileUploadService = (function () { let form; const fileSave = function (field) { var formData = new FormData(form[0]); formData.append("file", field.files[0]); const target = document.getElementById(field.dataset.ptyTarget); $.ajax({ url: viewUrls["upload-file"], data: formData, type: "POST", contentType: false, processData: false, success: function (data) { if (data.name && target) { target.value = data.name; } }, error: function (data) {}, }); }; const initFileSave = function (target) { form.on("change", target, function () { let fields = $(this); if (fields.attr("type") != "file") { return; } fileSave(this); }); document.querySelector('[data-kt-image-input-action="remove"]').addEventListener("click", function (event) { const target = document.getElementById(this.dataset.ptyTarget); target.value = null; $(target).trigger("change"); }); }; return { init: function (target) { form = $("#kt_page_add_form"); initFileSave(target); }, }; })();
| ver. 1.4 |
Github
|
.
| PHP 8.2.31 | Generation time: 0 |
proxy
|
phpinfo
|
Settings