0

I have problem with sending larger 2MB+ pdf files when I'm trying to send it I get 500 Internal Error but message is send with php mail() function with corrupted pdf file. With smaller ~500KB file is send and works fine. Can You please help me ? Thank You very much.

SERVER OPTION:

post_max_size: 64MB
upload_max_filesize: 60MB
max_execution_time: 300
memory_limit: 128MB

PHP:

            $allowedext =  array('doc','docx' ,'pdf'); // allowed extensions
            $maxsize = "10485760"; // 10MB Limit
            if(!empty($_FILES['f_file']['name'])){
                    if($_FILES['f_file']['size'] > $maxsize){
                        $file = false;  //control, default true, if false display error
                    }
                    if( !in_array(pathinfo(strtolower($_FILES['f_file']['name']), PATHINFO_EXTENSION),$allowedext)){
                        $file = false;   //control, default true, if false display error
                    }
            }
            if(!empty($_FILES['f_file2']['name'])){
                    if($_FILES['f_file2']['size'] > $maxsize){
                        $file = false; // control, default true, if false display error  
                    }
                    if( !in_array(pathinfo(strtolower($_FILES['f_file2']['name']), PATHINFO_EXTENSION),$allowedext)){
                        $file = false; // control, default true, if false display error   
                    } 
            }

HTML:

<form name="ats_form" action="" method="post" enctype="multipart/form-data">
<fieldset> 
<legend>Kontaktní osoba</legend> 

<table id="forms"> 
<colgroup><col class="left"><col></colgroup> 
<tbody><tr><td>&nbsp;</td><td width="280"><div style="align: left;"><input class="checkbox" type="radio" name="f_Head" value="Male" checked="checked"> 
 Pan&nbsp;&nbsp;&nbsp;&nbsp;</div><div style="align: left;"><input class="checkbox" type="radio" name="f_Head" value="Female"> 
 Paní / Slečna&nbsp;&nbsp;&nbsp;&nbsp;</div></td></tr><tr> 
<td>Jméno *</td> 
<td width="280"><input type="text" name="f_FName" size="30" value=""> 
</td> 
</tr> 
<tr> 
<td>Příjmení *</td> 
<td width="280"><input type="text" name="f_Lname" size="30" value=""> 
</td> 
</tr> 
<tr> 
<td>E-mail *</td> 
<td width="280"><input type="text" name="f_Email" size="30" value=""> 
</td> 
</tr> 
<tr> 
<td>Telefon *</td> 
<td width="280"><input type="text" name="f_Tel" size="30" value=""> 
</td> 
</tr> 
<tr> 
<td>Země *</td> 
<td width="280"><input type="text" name="f_PCountry" size="30" value="Česká republika"> 
</td> 
</tr> 
</tbody></table> 
</fieldset> 

<fieldset> 
<legend>Detajlní informace</legend> 

<table id="forms"> 
<colgroup><col class="left"><col></colgroup> 
<tbody><tr> 
<td>Název pozice</td> 
<td width="280"><input type="text" name="f_job" size="30" value="Software Test Analyst (home office)"> 
</td> 
</tr> 
<tr> 
<td>Průvodní text</td> 
<td width="280"><textarea type="textarea" name="f_letter" rows="8" cols="40"></textarea> 
</td> 
</tr> 
<tr> 
<td>Příloha</td> 
<td width="280"><input type="file" name="f_file" value=""> 
</td> 
</tr> 
<tr> 
<td>Příloha</td> 
<td width="280"><input type="file" name="f_file2" value=""> 
</td> 
</tr> 
</tbody></table> 
</fieldset> 

<input type="text" name="field0" size="3" value="" style="border: 0px; background-color: transparent;"> 
<input type="hidden" name="FTraining" value=""><input type="hidden" name="FCountry" value="cz"><input type="hidden" name="FLang" value="cs"><br><input class="btnform" type="submit" value="Odeslat" name="Submit">
</form>
  • Make sure that the error messages are displayed, http://stackoverflow.com/questions/1053424/how-do-i-get-php-errors-to-display, and post this here. – Alex Apr 09 '15 at 16:36
  • @Alex: ini_set() is disabled for security reason and error_reporting(-1). I enabled error log but there is nothing except one notice. Nothing more just 500 Internal Error at the end. – Josef _ Apr 09 '15 at 16:56

0 Answers0