controlling whether upload is attached to post or not

Solved, thanks to this post by Mike Jolley (see ‘Passing data to the uploader script’).