initial check-in (the renamed getgoodie.hac)
This commit is contained in:
parent
23662b18fc
commit
8249b45e05
1 changed files with 15 additions and 0 deletions
15
code/Site/getfile.hac
Normal file
15
code/Site/getfile.hac
Normal file
|
@ -0,0 +1,15 @@
|
|||
/**
|
||||
* 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());
|
||||
}
|
Loading…
Add table
Reference in a new issue