Forum OpenACS Q&A: Downloading uploads from BBoard Module

Trying to overcome the quirk in the bboard module,  where if you
upload a file, whenever you download the file,  it prompts you to
save it as upload-file.tcl which is the file which is called to
download the file.

Okay,  the same functionality is used in two other modules (File-
Storage and Downloads) an I thought that transferring working with
this other code,  I could get the bboard module to prompt the user to
save the file with the correct filename instead of the tcl file.

To try this I registered a proc (ns_register proc) filter so
whenever a user attempted to access http://localhost/bboard/files/*
it would run the proc taking the variable from the url where the *
is,  so to download file 2 we would access
http://localhost/bboard/files/2

I had a few troubles and ended up replicating what was in the upload-
file.tcl file from the bboard module in my registered proc.  I know
that the proc is getting the correct variables but it always fails
when I get to the part 'ns_returnfile 400 [ns_guesstype
$pseudo_filename] $filename'.  I'm actually using the exact code from
upload-file.tcl and I've hard coded all of the variables with the
correct values while I try and get round the problem.  What am I
likely to be doing wrong?  Is there something with ns_returnfile that
I'm missing.

Any ideas?

TIA