-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathModuleConfig.cfc
More file actions
63 lines (54 loc) · 2.08 KB
/
ModuleConfig.cfc
File metadata and controls
63 lines (54 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
component {
this.name = "UpChunk";
this.author = "Michael Born";
this.webUrl = "https://github.com/michaelborn/UpChunk";
function configure() {
settings = {
/**
* Temporary directory used for storing file chunks during upload.
*/
tempDir : "./tmp/",
/**
* Set the final resting place of uploaded files.
*/
uploadDir : "/resources/assets/uploads/",
/**
* Is the `chunkIndex` parameter zero-based?
*/
isIndexZeroBased : true,
/**
* what field names should we look for in the rc memento?
*/
"fields" : {
// points to the location of the uploaded binary
"file" : "fileUpload",
// filename, helpful for creating a user-friendly final filename
"filename" : "filename",
// An id unique to each chunked file upload session for tracking and organized groups of chunks.
"uniqueId" : "dzuuid",
// what chunk index is this current request?
"chunkIndex" : "dzchunkindex",
// total number of upload chunks, helps determine when the file is fully uploaded
"totalChunks": "dztotalchunkcount"
}
};
interceptorSettings = {
customInterceptionPoints = "UpChunk_preUpload,UpChunk_postUpload"
};
binder.map( "Uploader@upchunk" )
.to( "upchunk.models.vendors.Uploader" )
.asSingleton();
binder.map( "UpChunk@upchunk" )
.to( "upchunk.models.UpChunk" )
.asSingleton();
}
function onLoad(){
var fileSeparator = createObject("java","java.io.File").separator;
if ( right( settings.tempDir, 1) != fileSeparator ){
settings.tempDir &= fileSeparator;
}
if ( right( settings.uploadDir, 1) != fileSeparator ){
settings.uploadDir &= fileSeparator;
}
}
}