graham23s Posted November 4, 2007 Share Posted November 4, 2007 Hi Guys, i can't seem to figure this out, i get the message upload successful but the file hasn't moved, any ideas on what could be wrong? if($_POST['submit']) { $filesize = $_FILES['usersphoto']['size']; $filename = $_FILES['usersphoto']['tmp_name']; ## vars $maxheight = 500; $maxwidth = 500; if($filesize == 0) { stderr("Upload Failed","No file was uploaded."); include("includes/footer.php"); exit; } $imagedimensions = getimagesize($filename); $width = $imagedimensions[0]; $height = $imagedimensions[1]; if($width > $maxwidth || $maxheight > 500) { stderr("Upload Failed","Images cannot be larger than $maxwidth x $maxheight, yours was ($width) width and ($height) height, please try again."); include("includes/footer.php"); exit; } $uploaddirectory = 'uploads'; ## Move uploaded file if(move_uploaded_file($_FILES['usersphoto']['tmp_name'], $uploaddirectory)) { stderr("Upload Successful","Upload went well."); include("includes/footer.php"); exit; } thanks guys Graham Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted November 5, 2007 Share Posted November 5, 2007 I think that this is incorrect.... I think you need to change uploads. $uploaddirectory = 'uploads'; Try this: $uploaddirectory = 'uploads/'.$_FILES['usersphoto']['name']; 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.