@@ -13,26 +13,8 @@ Usage:
13
13
app .configure (function () {
14
14
...
15
15
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/'
36
18
}));
37
19
app .use (express .bodyParser ());
38
20
...
@@ -46,6 +28,29 @@ On the frontend:
46
28
<script >$ (' #fileupload' ).fileupload ({ dataType: ' json' }) </script >
47
29
```
48
30
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
+
49
54
## License
50
55
Copyright (c) 2012 [ Aleksandr Guidrevitch] ( http://aguidrevitch.blogspot.com/ )
51
56
Released under the [ MIT license] ( http://www.opensource.org/licenses/MIT ) .
0 commit comments