in reply to My .xlsx file attachments get corrupted with MIME::Lite::TT::HTML

use CGI->param instead of CGI->Vars , CGI->Vars has caveats , its broken by design

Also, get rid of sub uploader, its pointless :) as long as $query exists, so do the temporary files, its pointless to copy them

Also don't interleave sub declarations and main program logic flow, and make more subs, write like

use ... Main( @ARGV ); exit( 0 ); sub Main { my $query ... my @attachements = snafu_attaches( $query ); my $mime ... }

Similar advice in Re^3: How to store the output from foreach loop into variable/array without printing?, Re: RFC: beginner level script improvement (version control), Re^3: Blank HTTP POST request, if script has another module in it. (CGI.pm), ...

  • Comment on Re: My .xlsx file attachments get corrupted with MIME::Lite::TT::HTML
  • Download Code

Replies are listed 'Best First'.
Re^2: My .xlsx file attachments get corrupted with MIME::Lite::TT::HTML
by Tanscia (Initiate) on May 15, 2014 at 14:22 UTC
    Thanks for the help and advice, appreciated. I will investigate further ....