Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on May 16, 2018. It is now read-only.

Commite4b00b5

Browse files
committed
fieldName in options
1 parent7a983de commite4b00b5

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

‎example.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
$("#progress_report_bar").css('width',Math.ceil(val*100)+"%");
3535
},
3636
onFinishOne:function(event,response,name,number,total){
37-
alert(response);
37+
//alert(response);
3838
}
3939
});
4040
});

‎jquery.html5_upload.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
autoclear:true,
2525
stopOnFirstError:false,
2626
sendBoundary:false,
27+
fieldName:'user_file[]',//ignore if sendBoundary is false
2728

2829
STATUSES:{
2930
'STARTED':'Запуск',
@@ -127,7 +128,7 @@
127128

128129
if(window.FormData){//Many thanks to scottt.tw
129130
varf=newFormData();
130-
f.append('user_file[]',file);
131+
f.append(typeof(options.fieldName)=="function" ?options.fieldName() :options.fieldName,file);
131132
xhr.send(f);
132133
}
133134
elseif(file.getAsBinary){//Thanks to jm.schelcher
@@ -142,7 +143,7 @@
142143
builder+=boundary;
143144
builder+=crlf;
144145

145-
builder+='Content-Disposition: form-data; name="user_file[]"';
146+
builder+='Content-Disposition: form-data; name="'+(typeof(options.fieldName)=="function" ?options.fieldName() :options.fieldName)+'"';
146147
builder+='; filename="'+file.fileName+'"';
147148
builder+=crlf;
148149

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp