cooldude832 Posted July 28, 2007 Share Posted July 28, 2007 I've had this script and its worked before and now its extremely slow if i upload images and then doesn't place them in the folder or give me the die message. <?php //Image Handelers here // Your file name you are uploading $i = 0; $count = 0; //Lets add some nubmers for safety $random_digit = $_POST['random']; $us = "_"; $pathto = "/files/".$random_digit.$us; if ($_POST['newimages'] == "yes") { while ($i <= 3) { if ($_FILES['imagefile'.$i]['type'] == "image/jpeg" || $_FILES['imagefile'.$i]['type'] == "image/jpg" || $_FILES['imagefile'.$i]['type'] == "image/pjpeg" || $_FILES['imagefile'.$i]['type'] == "image/pjpg") { $count++; $file_name = ""; $file_name .= "temp."; $file_name .= str_replace(".jpg","",str_replace("/","",str_replace("image","",$_FILES['imagefile'.$i]['type']))); $ext = ".jpg"; //Lets make a new name $new_file_name=$random_digit.$us.$count.$ext; //Lets Path it $path[$count]= "files/".$new_file_name; if(copy($_FILES['imagefile'.$i]['tmp_name'], $path[$count])) {} else { die("Copy error"); } } $i++; } } else { $i=0; $count = 0; while ($i <=3) { if ($_POST['imgpath'.$i] != "") { $count++; $path[$count] = $_POST['imgpath'.$i]; } $i++; } } ?> Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 28, 2007 Share Posted July 28, 2007 dude are you sure you have the value for these $_FILES['imagefile'.$i]['tmp_name'] echo that first or why not use the move upload Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted July 28, 2007 Author Share Posted July 28, 2007 i got it to work on a 4.6kb image but i wanna upload a 1mb+ image and yes they are there Quote Link to comment Share on other sites More sharing options...
jitesh Posted July 28, 2007 Share Posted July 28, 2007 Try $_FILES['userfile']['error'] is this set any error number? If yes then which ? Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted July 28, 2007 Author Share Posted July 28, 2007 I figured it out my bandwidth got cut and that was causing timeout issues gotta blame server admins... 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.