msz Posted October 27, 2014 Share Posted October 27, 2014 Dear userI write a file upload code in php, the code work's fine but it will upload the file up to 60 KB, when i try to upload more then 60 KB file then the page stuck on loading.The problem is why it is not uploading more then 60kb file? is there any fault in my code please check it out..My form.php code is... <!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <link rel="stylesheet" href="css/bootstrap.css"/> <link rel="stylesheet" href="css/bootstrap.min.css"/> </head> <body> <div class="col-md-6"> <form action="upload.php" method="post" enctype="multipart/form-data"> <label for="">Item</label><br/> <input type="file" name="picture" class="form-control"><br/> <label for="">Description</label><br/> <textarea name="description" id="" placeholder="Enter Item Description" class="form-control" cols="50" rows="20"></textarea><br/> <input type="submit" name="submit" value="Upload" class="btn btn-success"> </form> </div> <script src="js/bootstrap.js"></script> <script src="js/bootstrap.min.js"></script> <script src="js/jquery-2.1.1.min.js"></script> <body> </html> my upload.php code is <?php include 'conn.php'; $desc=$_POST['description']; $image=$_FILES['picture']; $image_name=$_FILES['picture']['name']; $placed='uploads/'; if(move_uploaded_file($_FILES['picture']['tmp_name'],$placed.$image_name)) { $smt=$conn->prepare("INSERT INTO images(Image_Name,Description,Placed_On)VALUES('".$image_name."','".$desc."','".$placed."')"); $smt->execute(); header('location:form.php'); } else { echo 'error on uploading file'; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/292094-file-upload-in-php/ Share on other sites More sharing options...
tryingtolearn Posted October 27, 2014 Share Posted October 27, 2014 You say its just hanging - do you get any error pages? if your server has mod_security running I believe there is a file upload size limit there If its a shared server you may have to talk to your server folks to see if it can be changed (safely). Quote Link to comment https://forums.phpfreaks.com/topic/292094-file-upload-in-php/#findComment-1494935 Share on other sites More sharing options...
Barand Posted October 27, 2014 Share Posted October 27, 2014 Does $_FILES['picture']['error'] give any clues? Quote Link to comment https://forums.phpfreaks.com/topic/292094-file-upload-in-php/#findComment-1494955 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.