Product: FILE uploads
This commit is contained in:
+13
-5
@@ -326,6 +326,19 @@ function ajax_request(options) {
|
||||
|
||||
options.data = { json: JSON.stringify(payloadJson) };
|
||||
|
||||
if (options.debugMode) {
|
||||
isAjaxProcessing = false;
|
||||
// Show FormData contents if applicable
|
||||
if (options.formData instanceof FormData) {
|
||||
// Log original formData before merging
|
||||
for (let [key, value] of options.formData.entries()) {
|
||||
console.log("FORMDATA: " + key, value);
|
||||
}
|
||||
}
|
||||
// Show stringified JSON payload
|
||||
console.log("REQUEST DATA:", options.data);
|
||||
}
|
||||
|
||||
// IF formData exist, we pass as $_POST [not json]
|
||||
if (options.formData instanceof FormData) {
|
||||
// THE BYPASS: If formData exists, move all text data into it
|
||||
@@ -340,11 +353,6 @@ function ajax_request(options) {
|
||||
// --- START MODIFIED $.AJAX BLOCK ---
|
||||
let isSendingFiles = (options.data instanceof FormData);
|
||||
|
||||
if (options.debugMode) {
|
||||
isAjaxProcessing = false;
|
||||
console.log("REQUEST DATA:", options.data);
|
||||
}
|
||||
|
||||
// Show loading overlay
|
||||
if (options.noLoading !== true) {
|
||||
$.LoadingOverlay("show", {
|
||||
|
||||
Reference in New Issue
Block a user