# .. get data from blob into $blob_field. print "Content-type: application/octet-stream\n"; # or use the right content-type for the field if you know it print "Content-disposition: attachment; filename=somefile.ext\n\n"; binmode STDOUT; print $blob_field;