OK so I wrote a cgi page that up loads an excel xls spread sheet, to convert to html, but when I call Spreadsheet::XLSX -> new ($fh,$converter) I always get the Cannot open data as Zip archive at Spreadsheet/XLSX.pm line 28
However if I ftp the file to the linux server then open it with Spreadsheet::XLSX -> new ($file, $converter), it works fine. Why?
my $converter = Text::Iconv->new("utf-8","windows-1251"); if ( !$excelFile ){ die "Need a file name to upload"; } # end if no file name open($fh, "+>", undef) or die "Failed to write tempFile \n"; binmode($fh); while ($bytesread = read($excelFile, $buffer, $num_bytes)) { print $fh $buffer; } # end while seek($fh,0,0); my $excel = Spreadsheet::XLSX -> new ($fh,$converter); #(convert to html here)
I also tried uploading and copying to a file, then using its name as an argument to "Spreadsheet::XLSX -> new" Any ideas would be appreciated. Thanks & Regards Tom Bodinemy $file = shift @ARGV; my $converter = Text::Iconv->new("utf-8","windows-1251"); my $excel = Spreadsheet::XLSX -> new ($file, $converter); die "open failed" unless $excel; #(convert to html here)
In reply to Spreadsheet::XLS chokes on CGI uploads by tbodine88
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |