I’m writing a photo up-loader, if in my form I browse to xxx.jpg and submit it, it up loads fine and the $_FILES array is populated with data as expected. I can then write it from the temporary location to the gallery.
print_r ($_FILES); produces
Array ( [upload] => Array ( [name] => xxx.jpg [type] => image/jpeg [tmp_name] => /tmp/phpbsvDlA [error] => 0 [size] => 91662 ) )
BUT when I upload a file with .JPG (my client’s camera labels files .JPG not .jpg) as the suffix, the $_FILES array is not fully populated, so I can’t then save the file server-side. As you’ll see below, [error] is set to 1, [type] is set to tmp_name and [size] is set to 0.
print_r ($_FILES);
Produces
Array ( [upload] => Array ( [name] => yyy.JPG [type] => [tmp_name] => [error] => 1 [size] => 0 ) )
I’ve set the Form Action to <form action=“formChecker.php” name=“photoUploadForm” method=“POST” enctype=“multipart/form-data”>
Much ‘Googling’ has failed to find a way 'round this. I could tell the client to rename pics from .JPG to .jpg before using the form to upload them, but I can’t believe that there is such a fundamental case sensitive oopsie in PHP (5).
Any help would be welcome!
Thanks