MinusMyThoughts Posted November 19, 2006 Share Posted November 19, 2006 i'm running the code right off w3schools.com for a file upload, and for some reason or another, IE will NOT upload the file......it works fine in FF, so i'm not sure what's going on. i had declared all my $_FILES variables to something easier to remember, so i changed all that back, and i'm still having issues......here's the code i'm working with (the $debug variable is how i was checking what parts of the script were running; later in the script i echo $debug)... $debug = 'No dice.'; $picURL = ''; $pic_tmp = $_FILES['pic']['tmp_name']; $pic = $_FILES['pic']['name']; $pic_size = $_FILES['pic']['size']; $pic_type = $_FILES['pic']['type']; $pic_error = $_FILES['pic']['error']; if (($_FILES['pic']['type'] == "image/gif") || ($_FILES['pic']['type'] == "image/jpeg") && ($_FILES['pic']['size'] < 1024000)) { if ($_FILES['pic']['error'] > 0) { echo 'Error: ' . $_FILES['pic']['error']; } else { move_uploaded_file($_FILES['pic']['tmp_name'], 'images/praisePics/'.$_FILES['pic']['name']) or die("Could not save " . $pic ."!"); list($width, $height) = getimagesize('images/praisePics/'.$_FILES['pic']['name']); $sizeAdjust = 100/$width; $width = $width * $sizeAdjust; $height = $height * $sizeAdjust; $picURL = '<img src="images/praisePics/' . $_FILES['pic']['name'] . '" width="' . $width . '" height="' . $height . '" align="right">'; $debug = 'I am awesome!'; } } ...the only thing i can think of that would possibly be an issue is that the form i'm uploading with also passes several other $_POST variables that i store in a database with $picURL so i can retrieve the entry and attach the right image with it......i developed all of that code in FF, but my client uses IE. when i use IE to create an entry, everything works except the image. all of my database entries go through and can be correctly retrieved. my image just falls of the face of the planet, though, and i'm not sure how to prevent that issue...love,jason Link to comment Share on other sites More sharing options...
justsomeguy Posted November 19, 2006 Share Posted November 19, 2006 IE might not be sending the same mime type. Print out the type value to check it. Link to comment Share on other sites More sharing options...
MinusMyThoughts Posted November 19, 2006 Author Share Posted November 19, 2006 as in:echo $_FILES['pic']['type'];?i did that and it returned "image/pjpeg"......what does that mean? and what types should i clear? all i was hoping to do was allow GIF and JPEG images to upload......i appreciate any advice!...and, justsomeguy, do people ever buy you flowers or bake you cakes? they should...love,jason Link to comment Share on other sites More sharing options...
justsomeguy Posted November 20, 2006 Share Posted November 20, 2006 Yeah, IE sends the mime type of a jpeg as "image/pjpeg" for whatever reason. I'm not sure what that means, possibly something very esoteric. I guess just try uploading different things with IE and see what it tells you. If you only want images, gif, jpeg, and png are probably sufficient.And no, no one ever buys me flowers or bakes me a cake. But once I traded a guy in Finland some Mexican tequila for some Estonian vodka. So that was nice. Link to comment Share on other sites More sharing options...
MinusMyThoughts Posted November 20, 2006 Author Share Posted November 20, 2006 sounds good. i ended up clearing JPEG, GIF, and PJPEG......and, Lois, Who's The Boss is not a food.love,jason Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now