@@ -13,26 +13,8 @@ Usage:
1313 app .configure (function () {
1414 ...
1515 app .use (' /upload' , upload ({
16- uploadDir: __dirname + ' /public/uploads'
17- tmpDir: ' /tmp' ,
18- maxPostSize: 11000000000 , // 11 GB
19- minFileSize: 1 ,
20- maxFileSize: 10000000000 , // 10 GB
21- acceptFileTypes: / . + / i ,
22- // Files not matched by this regular expression force a download dialog,
23- // to prevent executing any scripts in the context of the service domain:
24- safeFileTypes: / \. (gif| jpe? g| png)$ / i ,
25- imageTypes: / \. (gif| jpe? g| png)$ / i ,
26- imageVersions: {
27- ' thumbnail' : {
28- width: 80 ,
29- height: 80
30- }
31- },
32- accessControl: {
33- allowOrigin: ' *' ,
34- allowMethods: ' OPTIONS, HEAD, GET, POST, PUT, DELETE'
35- }
16+ uploadDir: __dirname + ' /public/uploads' ,
17+ uploadUrl: ' /uploads/'
3618 }));
3719 app .use (express .bodyParser ());
3820 ...
@@ -46,6 +28,29 @@ On the frontend:
4628 <script >$ (' #fileupload' ).fileupload ({ dataType: ' json' }) </script >
4729```
4830
31+ Other options and their default values:
32+ ``` javascript
33+ tmpDir: ' /tmp' ,
34+ maxPostSize: 11000000000 , // 11 GB
35+ minFileSize: 1 ,
36+ maxFileSize: 10000000000 , // 10 GB
37+ acceptFileTypes: / . + / i ,
38+ // Files not matched by this regular expression force a download dialog,
39+ // to prevent executing any scripts in the context of the service domain:
40+ safeFileTypes: / \. (gif| jpe? g| png)$ / i ,
41+ imageTypes: / \. (gif| jpe? g| png)$ / i ,
42+ imageVersions: {
43+ thumbnail: {
44+ width: 80 ,
45+ height: 80
46+ }
47+ },
48+ accessControl: {
49+ allowOrigin: ' *' ,
50+ allowMethods: ' OPTIONS, HEAD, GET, POST, PUT, DELETE'
51+ }
52+ ```
53+
4954## License
5055Copyright (c) 2012 [ Aleksandr Guidrevitch] ( http://aguidrevitch.blogspot.com/ )
5156Released under the [ MIT license] ( http://www.opensource.org/licenses/MIT ) .
0 commit comments