initial check-in (the renamed getgoodie.hac)

This commit is contained in:
Robert Gaggl 2002-06-26 15:52:12 +00:00
parent 23662b18fc
commit 8249b45e05

15
code/Site/getfile.hac Normal file
View 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());
}