Hi,

Appreciate your kind response. I had initially posted a detailed post with my issue, I did not get much response, hence posted this, I have a web page returning the 'Page cannot be displayed ' error with no error code on the server (IIS 6). The error occurs randomly with no pattern. The page I am trying to print contains a link to a excel file available for download to the user.
AppPage.pl use strict; use CGI qw(:standard); use CGI::Carp('fatalsToBrowser'); use Spreadsheet::ParseExcel::SaveParser; print header(); print start_multipart_form(); if(param('Submit')){ if(param('file_upl')){ Display_File(); } }else{ Display_Main(); } sub Display_Main(){ print "Please upload file for processing"; print filefield(-name=>"file_upl",-accept=>'application/vnd.ms-exce +l') ; print submit(-name=>"Submit"); } sub Display_File{ my $fh = upload('upload_file'); if(!$fh){ print "file too big". $cgi_error(); exit 0; }else{ open (OUTFILE, ">> $file_path") or die("Can't open/create $file_n +ame".$!); binmode OUTFILE; while(<$fh>){ print OUTFILE; } close OUTFILE; } my $out_file = Read_Write_excel(); #Saves file in a folder on serve +r print "Thank you. Dowload"; print "<a href=file://///server/share/dir/$out_file>here</a>"; } sub Read_Write_excel{ my $out_file = 'C:\OUT_File.xls' my $parser = new Spreadsheet::ParseExcel::SaveParser; my $Book = $parser->Parse($file_path); my $Sheet = $Book->worksheet('Data'); my ($first_row,$last_row) = $Sheet->row_range(); my $key_col = 0; my $id; for(my $row=1;$row<=$last_row;$row++){ $id = $Sheet->get_cell($row,$key_col)->value(); if($id){ $col = $col++; $Sheet->AddCell($row,$col,'Id found'); } else{ $col = $col++; $Sheet->AddCell($row,$col,'Id Not found'); } } $Book->SaveAs($out_file); return $out_file;

Debugging Options tried out: 1. Checked IIS log files for HTTP Error code or error messages. Nothing found. 2. Used fiddler to get HTTP Response code in this case, and still only saw 200 there even when the page broke. 3.Tried using log Parser on IIS Server side to catch http code. Nothing there too.

Appreciate any pointers.


In reply to Re^2: Capture HTTP Error in Perl by suzun30
in thread Capture HTTP Error in Perl by suzun30

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.