viewfile was recently introduced to enable access rights to the attachments.
So viewfile is a good thing in itself.
But it gives at least TWO issues the way it works now.
- The URL you get when you copy the link from the attachment table is not at all easy to get to work with programs such a wget. I have many complaints about it from my Motion TWiki.
- The filename given to viewfile is in a parameter to the URL instead of being part of the URL itself. This makes it impossible to make a redirect rule in Apache to redirect links to spam html files for example. And the spammers have found out about this now. I have seen spam on my TWiki where the viewfile URL had been used when spamming other guestbooks and blogs.
The solution that will solve both is
The URL such as
and defaulting to latest revision if there is no 'rev' parameter.
This would make both wget and redirect rules work.