shadiadiph Posted February 18, 2009 Share Posted February 18, 2009 Hi I don't get this it works fine but any file i upload that is over 300kb doesn't get emailed or saved to the server but if i upload two files for example 260kb 290kb they both upload and are both saved to the server. here is what I am using. Why is this doing this I find this very odd why if 1 file is more than 300kb?? <form name="iapply3" method="post" action="../submit/isubmit.php" enctype="multipart/form-data"> <input type="hidden" name="MAX_FILE_SIZE" value="10000000" /> <input type="hidden" name="usename" value="johnny99" /> <table class="form"> <tr><td colspan="2" class="head">PHOTO 1</td></tr> <tr><td colspan="2" class="name"><input type="file" name="fileatt[]" /></td></tr> <tr><td colspan="2" class="head">PHOTO 2</td></tr> <tr><td colspan="2" class="name"><input type="file" name="fileatt[]" /></td></tr> <tr><td colspan="2" class="head">SEND LATER</td></tr> <tr><td colspan="2" class="selection"><input type="checkbox" name="later" value="Yes" /></td></tr> <tr><td class="head"> </td><td class="head"> </td></tr> <tr><td colspan="2" class="submit" ><input name="submit" type="submit" value="Submit" /></td></tr> <tr><td colspan="2" class="submit"><input name="reset" type="reset" value="Reset" /></td></tr> <tr><td class="head"> </td><td class="head"> </td></tr> </table> </form> </body> </html> <? session_start(); error_reporting(apa); error_reporting(7); include("../secure/global/connection.php"); $username = $_POST["username"]; mkdir("../secure/admin/clients/$username", 0700); $to = 'info@website.com'; $subject = "Success"; $boundary = '==Multipart_Boundary_x' .md5(time()). 'x'; // headers $headers .= "From: Website <noreply@websire.com>\n"; $headers .= "MIME-Version: 1.0\n"; $headers .= "Content-Type: multipart/mixed;\n boundary=\"$boundary\"\n\n"; // message $message = "--{$boundary}\n"; $message .= "Content-Type: text/html; charset=iso-8859-1\n"; $message .= "Content-Transfer-Encoding: 7bit\n\n"; $message .= "<html> <head> <title>HTML message</title> </head> <body> message here </body> </html>"; foreach ($_FILES["fileatt"]["error"] as $key => $error) { if ($error == UPLOAD_ERR_OK) { $fileatt = $_FILES['fileatt']['tmp_name'][$key]; $fileatt_type = $_FILES['fileatt']['type'][$key]; $fileatt_name = $_FILES['fileatt']['name'][$key]; // attachment $fp = fopen($fileatt, 'rb'); $data = fread($fp, filesize($fileatt)); fclose($fp); $data = chunk_split(base64_encode($data)); $message .= "\n\n"; $message .= "--{$boundary}\n"; $message .= "Content-Type: application/$fileatt_type; name=\"$fileatt_name\"\n"; $message .= "Content-Transfer-Encoding: base64\n\n"; $message .= "$data\n\n"; move_uploaded_file($fileatt, "./../secure/admin/clients/$username/$fileatt_name"); } } mail($to, $subject, $message, $headers); ?> Quote Link to comment Share on other sites More sharing options...
gizmola Posted February 18, 2009 Share Posted February 18, 2009 There are several settings that limit this, in the php.ini and the apache server itself. These are covered here: http://us3.php.net/manual/en/features.file-upload.common-pitfalls.php. One or both may be limiting your file size. Quote Link to comment Share on other sites More sharing options...
shadiadiph Posted February 18, 2009 Author Share Posted February 18, 2009 mm tried that link came up with a 404 error page cannot be found sorry I forget how do you check the ini settings again in the server? Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted February 18, 2009 Share Posted February 18, 2009 The link is http://www.php.net/manual/en/features.file-upload.common-pitfalls.php (notice, no "." at the end of the URL) Ken Quote Link to comment Share on other sites More sharing options...
shadiadiph Posted February 18, 2009 Author Share Posted February 18, 2009 mm got it working anyway thanks for people who have the same problem I used ini_set ('upload_max_filesize','10M'); in the top of my submit file Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.