15 lines
472 B
Text
15 lines
472 B
Text
|
/**
|
||
|
* this action tries to get a file with the given name
|
||
|
* if it finds it, it increases the request-counter of this file
|
||
|
* sets the appropriate mimetype and redirects the browser to the file
|
||
|
*/
|
||
|
|
||
|
var f = this.files.get(req.data.name);
|
||
|
if (f) {
|
||
|
f.requestcnt++;
|
||
|
res.contentType = f.mimetype;
|
||
|
res.redirect(getProperty("fileUrl") + this.alias + "/" + f.name);
|
||
|
} else {
|
||
|
res.message = getMsg("error","fileNotFound",req.data.name);
|
||
|
res.redirect(this.href());
|
||
|
}
|