You can actually get away with not knowing the content-type, you just default to application/octet-stream.
Give the following a try, it is very nice. All you will need to do is perform a length() on the data and give a filename.
my $size = length ($blob);
my $filename = 'good_data.txt';
-Content-Disposition => "attachment; filename=$filename",
-Content-Type => 'application/octet-stream',
-Content-Length => $size,
-Pragma => 'no-cache',
-Expires => 0 );