Creating temporary URLs and redirecting them

Permalink
I am building a package for a client, and I would really like to be able to create temporary file URLs like example.com/path/file_<serial>.dat and have the requests captured by c5 and directed to my script. Is there a nice way to do this within c5? I know the system is handling the URL since it sends me to the 'Page not found' page.

 
Mnkras replied on at Permalink Reply
Mnkras
if you tell us what your trying to do in more detail then we might be able help you better,
loopytech replied on at Permalink Reply
I need a file that will be created on demand, but the software that will be pulling it is actually expecting a file extension or .dat at the end of the URL (I don't have control over this), so I can't get away with passing it to the script directly.

My current solution is to use an additional arguement in my .htaccess for mod_rewrite, but I was hoping there maybe a pure concrete5 solutions with some sort of API hook for URL catching.
ScottC replied on at Permalink Reply
ScottC
there is, but you need to have a controller that can catch the request, set the header, output the file, and return false or exit.

You would want to either direct someone at a tools file, or a single page, tools is the easier approach but your urls would look like:

whatever.com/index.php/tools/file/whatever.dat

while a singlepage can be

whatever.com/index.php/whatever/file/filename.dat

whatever is your singlepage, the controller has a method named file, and the filename.nat is the first requestTaskParameter.

There are other ways as well, but that should get you started.