Permalink
Browse files

Added error handling and increased the default size restrictions.

  • Loading branch information...
1 parent b6e1be4 commit a10ee03875262d88399c9abd0c73621e353e79a9 @blueimp committed Sep 20, 2012
Showing with 10 additions and 8 deletions.
  1. +3 −3 server/node/package.json
  2. +7 −5 server/node/server.js
View
@@ -1,6 +1,6 @@
{
"name": "blueimp-file-upload-node",
- "version": "1.0.2",
+ "version": "1.0.3",
"title": "jQuery File Upload Node.js example",
"description": "Node.js implementation example of a file upload handler for jQuery File Upload.",
"keywords": [
@@ -33,8 +33,8 @@
}
],
"dependencies": {
- "formidable": ">=1.0.8",
- "node-static": ">=0.5.9",
+ "formidable": ">=1.0.11",
+ "node-static": ">=0.6.2",
"imagemagick": ">=0.1.2"
},
"main": "server.js"
View
@@ -1,6 +1,6 @@
#!/usr/bin/env node
/*
- * jQuery File Upload Plugin Node.js Example 1.0.2
+ * jQuery File Upload Plugin Node.js Example 1.0.3
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2012, Sebastian Tschan
@@ -10,8 +10,8 @@
* http://www.opensource.org/licenses/MIT
*/
-/*jslint nomen: true, regexp: true, unparam: true */
-/*global require, __dirname, unescape */
+/*jslint nomen: true, regexp: true, unparam: true, stupid: true */
+/*global require, __dirname, unescape, console */
(function (port) {
'use strict';
@@ -27,9 +27,9 @@
publicDir: __dirname + '/public',
uploadDir: __dirname + '/public/files',
uploadUrl: '/files/',
- maxPostSize: 500000000, // 500 MB
+ maxPostSize: 11000000000, // 11 GB
minFileSize: 1,
- maxFileSize: 100000000, // 100 MB
+ maxFileSize: 10000000000, // 10 GB
acceptFileTypes: /.+/i,
// Files not matched by this regular expression force a download dialog,
// to prevent executing any scripts in the context of the service domain:
@@ -256,6 +256,8 @@
tmpFiles.forEach(function (file) {
fs.unlink(file);
});
+ }).on('error', function (e) {
+ console.log(e);
}).on('progress', function (bytesReceived, bytesExpected) {
if (bytesReceived > options.maxPostSize) {
handler.req.connection.destroy();

0 comments on commit a10ee03

Please sign in to comment.