pmzq Posted July 23, 2007 Share Posted July 23, 2007 I've got a photo uploading script to upload images to the webserver: $naam = $HTTP_POST_FILES['mijnbestand']['name']; $type = $HTTP_POST_FILES['mijnbestand']['type']; $size = $HTTP_POST_FILES['mijnbestand']['size']; if ($naam){ // we stellen de maximale omvang in op 100kb $max = 1000000; // Als de bestandsgrootte groter is dan de maximale grootte dan….. if ($HTTP_POST_FILES['mijnbestand']['size'] > $max) { // als ie dus groter is echo'en we een error echo "Het bestand is groter dan 1Mb !!"; } // anders gaan we het bestand uploaden else { //zoals je ziet doen we dat met de functie copy() move_uploaded_file($HTTP_POST_FILES['mijnbestand']['tmp_name'], $foto_plaats . $HTTP_POST_FILES['mijnbestand']['name']); //en we echo'en nog even een berichtje //dat het bestand is geupload // Content type header('Content-type: image/jpeg'); echo "<center>Je hebt net het bestand $naam met succes geupload</center>"; // zet de naam van het bestand in de database mysql_query("insert into foto set foto='$naam'"); if ($HTTP_POST_FILES['mijnbestand']['name']=="none" OR $HTTP_POST_FILES['mijnbestand']['name']="") { //no file uploaded echo "<center>Je hebt geen foto geselecteerd</center>"; } } } When I try to upload a picture with these properties: Width = 600px, Height = 400px and it's 80kb's. Then the first time it works fine very fast it uploads. Second time works aswell. But then the 3rd time it keeps trying untill I get the browser error that the page couldn't be reached ? Even when I shutdown my browser and try again it fails. Could it be something with the memory being full at the server or something ? Does anyone have a clue where the flaw may be ? at the server or at the script or at my pc ? Many thnx! pMzQ, Quote Link to comment Share on other sites More sharing options...
btherl Posted July 23, 2007 Share Posted July 23, 2007 Is that your entire script? And does the error happen with every image, or only one image? Quote Link to comment Share on other sites More sharing options...
pmzq Posted July 23, 2007 Author Share Posted July 23, 2007 I tried it with a different picture now properties of this pic are: Width = 1280, Height = 1024 and it is 400 kb big it seams to work endlessly times ? And yes this is the code that is uploading the image Quote Link to comment Share on other sites More sharing options...
Guardian-Mage Posted July 23, 2007 Share Posted July 23, 2007 What exactly happens? Is there any error messages? And maybe translate comments into English for us Quote Link to comment Share on other sites More sharing options...
pmzq Posted July 23, 2007 Author Share Posted July 23, 2007 No there is no error message my browser just tells me that it can not reach the page after a long time... The comments aren't very informative and the code isn't that hard it just does what it does upload the file and doesn't if the image is larger then $max... 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.