NYCPHP Meetup

NYPHP.org

[nycphp-talk] upload error

aaron aaron at aarond.com
Thu Feb 9 11:15:36 EST 2006


Here is an example

*My simple code*

<form name="imgform" action="test.php" method="POST" 
enctype="multipart/form-data">
Image File
<input type="hidden" name="MAX_FILE_SIZE" value="2100000">
<input type="file" name="imgfile">
<input type="submit">
</form>

<?php
if($_FILES['imgfile'])
{
 move_uploaded_file( $_FILES['imgfile']['tmp_name'], 
'testimg/'.$_FILES['imgfile']['name'] ); 
} // end post
?>


For test images I just google image searched 'birds' and picked the swan 
image (2nd one)
http://lynx.uio.no/jon/gif/animals/birds/swans.jpg

This works on Mac safari, PC IE/Mozilla/Firefox but not Mac IE.  When I 
try to open the file on my pc it says 'Can't determine type'

Any thoughts?  Is this sample image faulty?



tedd wrote:

>>I just noticed that some jpg files will get uploaded, but others 
>>won't. Strange.
>>I'm not sure what the difference is yet.
>>    
>>
>
>
>Could be a couple of things: a) size -- check the size. I've had 
>jpg's load only a portion because of size limits; 2) some jpgs have 
>jpeg suffix -- check suffix and the defaults with your server.
>
>HTH's
>
>tedd
>
>  
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20060209/a4780c81/attachment.html>


More information about the talk mailing list