Skip to content

Commit abd4819

Browse files
committed
fixed progress end for ie8
1 parent b7e314a commit abd4819

File tree

4 files changed

+4
-20
lines changed

4 files changed

+4
-20
lines changed

demo/src/com/df/angularfileupload/FileUpload.java

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import java.io.IOException;
55
import java.io.InputStream;
66
import java.io.InputStreamReader;
7-
import java.io.PrintWriter;
87
import java.util.Enumeration;
98

109
import javax.servlet.ServletException;
@@ -48,14 +47,7 @@ protected void service(HttpServletRequest req, HttpServletResponse res) throws S
4847
}
4948
}
5049
} else {
51-
res.setContentType("application/json");
52-
PrintWriter printWriter = new PrintWriter(res.getOutputStream());
53-
try {
54-
sb.append("{\"size\":\"" + size(req.getInputStream()) + "\"}");
55-
printWriter.flush();
56-
} finally {
57-
printWriter.close();
58-
}
50+
sb.append("{\"size\":\"" + size(req.getInputStream()) + "\"}");
5951
}
6052

6153
sb.append("]");
@@ -71,14 +63,7 @@ protected void service(HttpServletRequest req, HttpServletResponse res) throws S
7163
}
7264
sb.append("}}");
7365

74-
res.setContentType("application/json");
75-
PrintWriter printWriter = new PrintWriter(res.getOutputStream());
76-
try {
77-
printWriter.print(sb.toString());
78-
printWriter.flush();
79-
} finally {
80-
printWriter.close();
81-
}
66+
res.getWriter().write(sb.toString());
8267
} catch (Exception ex) {
8368
throw new ServletException(ex);
8469
}
Binary file not shown.

demo/war/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,6 @@ <h3>
7777
</ul>
7878
</div>
7979
</div>
80-
<div style="position:absolute;bottom:10px;right:10px;font-size:smaller;color:#777">Last update: 2013-12-30</div>
80+
<div style="position:absolute;bottom:10px;right:10px;font-size:smaller;color:#777">Last update: 2014-02-19</div>
8181
</body>
8282
</html>

demo/war/js/angular-file-upload-shim.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ if (window.XMLHttpRequest) {
9090
var config = {
9191
url: xhr.__url,
9292
complete: function(err, fileApiXHR) {
93-
xhr.__load({type: 'load', loaded: xhr.__total, total: xhr.__total, target: xhr, lengthComputable: true});
93+
if (!err) xhr.__load({type: 'load', loaded: xhr.__total, total: xhr.__total, target: xhr, lengthComputable: true});
9494
if (fileApiXHR.status !== undefined) Object.defineProperty(xhr, 'status', {get: function() {return fileApiXHR.status}});
9595
if (fileApiXHR.statusText !== undefined) Object.defineProperty(xhr, 'statusText', {get: function() {return fileApiXHR.statusText}});
9696
Object.defineProperty(xhr, 'readyState', {get: function() {return 4}});
@@ -229,7 +229,6 @@ if (!window.FormData) {
229229
}
230230

231231
if (FileAPI.staticPath == null) FileAPI.staticPath = basePath;
232-
FileAPI.debug = true;
233232
script.setAttribute('src', jsUrl || basePath + "FileAPI.min.js");
234233
document.getElementsByTagName('head')[0].appendChild(script);
235234
}

0 commit comments

Comments
 (0)