in reply to Deliver a file via HTTPS
You could convert all that logic to:
Then simply key into the hash with $format. I also suggest not using binmode STDOUT when the MIME type is text/plain.my %mimeTypes = ( 'pdf' => 'application/pdf', 'xls' => 'application/vnd.ms-excel', 'xml' => 'text/xml', 'csv' => 'text/plain');
|
|---|