mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-01 08:12:17 +09:00
Patch exec_json() and related functions to support file uploads
This commit is contained in:
parent
0a625662f7
commit
d45c116c56
2 changed files with 35 additions and 6 deletions
|
|
@ -215,7 +215,12 @@
|
|||
var action_parts = action.split('.');
|
||||
var request_info;
|
||||
if (action === 'raw') {
|
||||
request_info = 'RAW FORM SUBMISSION';
|
||||
if (params instanceof FormData) {
|
||||
request_info = params.get('module') + '.' + params.get('act');
|
||||
} else {
|
||||
request_info = 'RAW FORM SUBMISSION';
|
||||
}
|
||||
console.log(request_info);
|
||||
} else {
|
||||
params = params ? ($.isArray(params) ? arr2obj(params) : params) : {};
|
||||
//if (action_parts.length != 2) return;
|
||||
|
|
@ -342,7 +347,7 @@
|
|||
|
||||
// Send the AJAX request.
|
||||
try {
|
||||
$.ajax({
|
||||
var args = {
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
url: url,
|
||||
|
|
@ -351,7 +356,11 @@
|
|||
headers : headers,
|
||||
success : successHandler,
|
||||
error : errorHandler
|
||||
});
|
||||
};
|
||||
if (params instanceof FormData) {
|
||||
args.contentType = false;
|
||||
}
|
||||
$.ajax(args);
|
||||
} catch(e) {
|
||||
alert(e);
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue