Skip to content

Commit b75f418

Browse files
committed
Issue 12
1 parent 80e9b03 commit b75f418

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

example.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33
<head>
44
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript"></script>
5-
<script src="http://jquery-html5-upload.googlecode.com/svn/trunk/jquery.html5_upload.js" type="text/javascript"></script>
5+
<script src="jquery.html5_upload.js" type="text/javascript"></script>
66
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
77
</head>
88
<body>
@@ -17,8 +17,8 @@
1717
<script type="text/javascript">
1818
$(function() {
1919
$("#upload_field").html5_upload({
20-
url: function() {
21-
return prompt("Url", "/");
20+
url: function(number) {
21+
return prompt(number + " url", "/");
2222
},
2323
sendBoundary: window.FormData || $.browser.mozilla,
2424
onStart: function(event, total) {

jquery.html5_upload.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
stopOnFirstError: false,
2626
sendBoundary: false,
2727
fieldName: 'user_file[]',//ignore if sendBoundary is false
28+
method: 'post',
2829

2930
STATUSES: {
3031
'STARTED': 'Запуск',
@@ -115,7 +116,7 @@
115116
upload_file(number+1);
116117
}
117118
};
118-
xhr.open("post", typeof(options.url) == "function" ? options.url() : options.url, true);
119+
xhr.open(options.method, typeof(options.url) == "function" ? options.url(number) : options.url, true);
119120
xhr.setRequestHeader("Cache-Control", "no-cache");
120121
xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
121122
xhr.setRequestHeader("X-File-Name", file.fileName);

0 commit comments

Comments
 (0)