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> </td><td width="280"><div style="align: left;"><input class="checkbox" type="radio" name="f_Head" value="Male" checked="checked">
Pan </div><div style="align: left;"><input class="checkbox" type="radio" name="f_Head" value="Female">
Paní / Slečna </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>