Home » HTML » HTML_QuickForm » Bug #5689
mimetype bad validation in IE
Details
| Submitted | 2005-10-14 08:29 UTC |
|---|---|
| From | drypek at nastopa dot pl |
| Status | Bogus |
| Package | HTML_QuickForm |
| PHP Version | 5.0.4 |
| OS | debian 3.1 |
| Roadmaps | (Not assigned) |
Comments
[2005-10-14 08:29 UTC] drypek at nastopa dot pl
Description:
------------
bug is only in IE. in firefox and opera it is OK.
when i add photo (test.jpg) form show error: its not jpg file.
Test script:
---------------
$form = new HTML_QuickForm('form','POST','?page=form_fotki_dodawanie&id='.$_GET['id'].'&id2='.$_GET['id2'], '', 'ENCTYPE="multipart/form-data"');
$form->addElement('file','fotka','Fotografia:');
$form->addElement('submit','dodaj','Dodaj fotografię');
$form->addRule('fotka','Podaj prawidłową ścieżkę do pliku typu JPG','mimetype',array('image/jpeg','image/jpeg'));
$form->addRule('fotka','Załaduj plik','uploadedfile');
if ($form->validate()) {
$zdjecieForma1 = $form -> getSubmitValue('fotka');
if ($zdjecieForma1["tmp_name"])
{
$zdjecie = new zdjecia($zdjecieForma1["tmp_name"], $zdjecieForma1["name"],$sciezka_do_fotek);
$admin -> fotkiDodaj($_GET['id'],$_GET['id2'],$zdjecie->nazwa);
}
header("Location: ?page=fotki_edytuj&id=".$_GET['id']."&id2=".$_GET['id2']);
}
Expected result:
----------------
form validate when i add jpg file in IE.
Actual result:
--------------
form not validate when i add jpg file in IE. in opera and firefox is ok.
[2005-10-14 09:20 UTC] mansion at php dot net
Thank you for taking the time to write to us, but this is not
a bug.
The mime type you specify (image/jpeg) is probably wrong for IE. Try with something else, search Google for the correct mime type that will work with IE browsers.