abubaker0000 Posted October 4, 2014 Share Posted October 4, 2014 (edited) <!doctype html> <html> <head> <meta content="text/html; charset=utf-8" http-equiv="content-type"> <title>Untitled Document</title> </head> <body> <form action="upload_image.php" method="post" enctype="multipart/form-data"> <label>select page<input type="file" name="image"> <input type="submit" name="upload"> </label> </form> <?php if(isset($_POST['upload'])) { $image_name=$_FILES['image']['name']; //return the name ot image $image_type=$_FILES['image']['type']; //return the value of image $image_size=$_FILES['image']['size']; //return the size of image $image_tmp_name=$_FILES['image']['tmp_name'];//return the value if($image_name=='') { echo '<script type="text/javascript">alert("please select image")</script>'; exit(); } else { $ex=move_uploaded_file($image_tmp_name,"image/".$image_name); if($ex) { echo 'image upload done "<br>"'; echo $image_name.'<br>'; echo $image_size.'<br>'; echo $image_type.'<br>'; echo $image_tmp_name.'<br>'; } else { echo 'error'; } } } ?> </body> </html> I make this simple script for upload files like photo , It's work correctly ,but not upload the large files ex 8MB images 12MB images Edited October 4, 2014 by Ch0cu3r Modified topic title - changed download to upload Quote Link to comment https://forums.phpfreaks.com/topic/291434-script-cant-upload-the-large-files/ Share on other sites More sharing options...
Strider64 Posted October 4, 2014 Share Posted October 4, 2014 In your php.ini there is upload_max_filesize = 8000M ;8GB that determines how large of a file that can be uploaded. Quote Link to comment https://forums.phpfreaks.com/topic/291434-script-cant-upload-the-large-files/#findComment-1492707 Share on other sites More sharing options...
Ch0cu3r Posted October 4, 2014 Share Posted October 4, 2014 (edited) There are many configuration settings which determines the maximum file size that can be uploaded. upload_max_filesize is one of them. There is also post_max_size, max_execution_time and max_input_time. This page explains the common pitfalls you may experience when uploading files. Unless you have access to the php.ini you may not be able to override these settings. You may be able to use ini_set or Apache .htaccess php_flag directives to override those settings. If your host does not allow this then will not be able to upload files larger than the limit your host current allows. NOTE: I have modified your topic title. Edited October 4, 2014 by Ch0cu3r Quote Link to comment https://forums.phpfreaks.com/topic/291434-script-cant-upload-the-large-files/#findComment-1492722 Share on other sites More sharing options...
abubaker0000 Posted October 4, 2014 Author Share Posted October 4, 2014 it's by default but cant upload 12MB size image also when I upload a large size image the not give me "DONE" or "ERROR" in the browser Quote Link to comment https://forums.phpfreaks.com/topic/291434-script-cant-upload-the-large-files/#findComment-1492726 Share on other sites More sharing options...
Ch0cu3r Posted October 4, 2014 Share Posted October 4, 2014 When modifying the php.ini you may need to restart your http server in order for the new settings to take affect. You should also run phpinfo() to confirm PHP is reading the php.ini you are editting and to confirm the changes you made in the php.ini has taken affect too. Quote Link to comment https://forums.phpfreaks.com/topic/291434-script-cant-upload-the-large-files/#findComment-1492728 Share on other sites More sharing options...
jcbones Posted October 4, 2014 Share Posted October 4, 2014 Also, you need to secure that script. Anyone could upload a php file to it, and do massive amounts of evil with it. Quote Link to comment https://forums.phpfreaks.com/topic/291434-script-cant-upload-the-large-files/#findComment-1492744 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.