swissbeets Posted July 28, 2008 Share Posted July 28, 2008 I am using the uploader.php that is in a tutorial to upload pictures to my site. but when i upload them everything is working fine except that the pictures are not being saved in my images folder(everything being, the name is saving in the database and being called correctly) maybe another set of eyes could help me spot the problem, here is my code <?php require_once("includes/session.php"); ?> <?php require_once("includes/connection.php"); ?> <?php require_once("includes/functions.php"); ?> <?php confirm_logged_in(); //echo "<pre>"; //print_r($_FILES); //echo "</pre>"; $target_path = "images/".$_FILES['uploadedfile']['name']; move_uploaded_file($_FILES['uploadedfile']['tmp_name'],$target_path); $image_source = mysql_prep($_FILES['uploadedfile']['name']); $id = $_GET['page']; $query = "UPDATE pages SET image_source = '$image_source' WHERE id = $id"; $result = mysql_query($query); if (mysql_affected_rows() == 1) { redirect_to("edit_page.php"); } else { // Failed $message = "The product update failed."; $message .= "<br />". mysql_error(); echo $message; }?> here is where the actualy information is coming from <form enctype="multipart/form-data" action="uploader.php?page=<?php echo $sel_page['id']; ?>" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="100000" /> Choose a file to upload: <input name="uploadedfile" type="file" value= "<?php print $sel_page['image_source']; ?>"/> <input type="submit" value="Upload File" /> </form> Quote Link to comment https://forums.phpfreaks.com/topic/117032-help-wiht-file-upload/ Share on other sites More sharing options...
swissbeets Posted July 28, 2008 Author Share Posted July 28, 2008 nvm i was uploading a file too large Quote Link to comment https://forums.phpfreaks.com/topic/117032-help-wiht-file-upload/#findComment-601972 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.