Upload file on IE8
am 25.01.2010 23:41:11 von Ernie Kemp
------=_NextPart_000_0013_01CA9DE5.96854B30
Content-Type: multipart/alternative;
boundary="----=_NextPart_001_0014_01CA9DE5.96854B30"
------=_NextPart_001_0014_01CA9DE5.96854B30
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
Good Day,
I'm having an issue with IE8, when I go to load a file the
program is not filling the $_FILES['user_file']['type'] .
When I display "echo "Start".$_FILES['pix']['type']."End";"
in IE8 I get "StartEnd" with nothing in between. I expected "image/pjpeg".
On FireFox I get "image/jpeg".
Any suggestions?
Thanks,
...../Ernie
------=_NextPart_001_0014_01CA9DE5.96854B30
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:dt=3D"uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns=3D"http://www.w3.org/TR/REC-html40">
charset=3Dus-ascii">
lang=3DEN-CA
link=3D"#996600" vlink=3D"#666666">
v:src=3D"cid:image001.jpg@01CA9DE4.E9E90FB0" v:shapes=3D"_x0000_Mail" =
width=3D0
height=3D0 class=3Dshape style=3D'display:none;width:0;height:0'>
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:windowtext'>Good Day,
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:windowtext'>
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:windowtext'> &=
nbsp; I’m
having an issue with IE8, when I go to load a file the program is not =
filling
the $_FILES['user_file']['type'] .
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif"'>  =
; When =
I display “echo =
"Start".$_FILES['pix']['type']."End";” =
in IE8 I get “StartEnd” with nothing in between. =
I expected “
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#33333=
3'>image/pjpeg".
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#33333=
3'>
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#33333=
3'> &nbs=
p; On FireFox I get =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif"'>“
an>
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#33333=
3'>image/jpeg".
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#33333=
3'>
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#33333=
3'> &nbs=
p; Any =
suggestions?
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#33333=
3'>Thanks,
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#33333=
3'>..../Ernie
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#33333=
3'>
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:windowtext'>
style=3D'font-size:11.0pt;font-family:"Ancestory SF";
color:windowtext'>
style=3D'font-size:11.0pt;font-family:"Ancestory SF";
color:windowtext'>
style=3D'font-size:11.0pt;font-family:"Ancestory SF";
color:windowtext'>
------=_NextPart_001_0014_01CA9DE5.96854B30--
------=_NextPart_000_0013_01CA9DE5.96854B30--
Re: Upload file on IE8
am 25.01.2010 23:52:39 von Ashley Sheridan
--=-nqDSq9i+dfghOmbZ6TUF
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
On Mon, 2010-01-25 at 17:41 -0500, Ernie Kemp wrote:
>=20
>=20
> Good Day,
>=20
> =20
>=20
> Iâ=99m having an issue with IE8, when I go to load a=
file
> the program is not filling the $_FILES['user_file']['type'] .
>=20
>=20
> When I display â=9Cecho "Start".$_FILES['pix']['type=
']."End";â=9D in IE8 I get â=9CStartEndâ=9D with nothing in=
between. I expected â=9Cimage/pjpeg".
> =20
> On FireFox I get â=9Cimage/jpeg".
> =20
> Any suggestions?
> Thanks,
> ..../Ernie
> =20
>=20
>=20
> =20
What do the other $_FILES fields say? Are they populated correctly?
I wouldn't rely on anything sent from the browser. IE is known to send
the mime type that matches the extension, not the contents of the file,
and for .jpg images it sends a different mime to every other browser
anyway, so it's pretty unreliable.
Thanks,
Ash
http://www.ashleysheridan.co.uk
--=-nqDSq9i+dfghOmbZ6TUF--
Re: Upload file on IE8
am 26.01.2010 00:33:48 von Eric Lee
--001636c92336e2e0ac047e0599f4
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
On Tue, Jan 26, 2010 at 6:41 AM, Ernie Kemp wrote=
:
> Good Day,
>
>
>
> Iâ=99m having an issue with IE8, when I go to load a=
file the
> program is not filling the $_FILES['user_file']['type'] .
>
> When I display â=9Cecho "Start".$_FILES['pix']['type=
']."End";â=9D in IE8 I get â=9CStartEndâ=9D with nothing in=
between. I expected â=9Cimage/pjpeg".
>
>
>
> On FireFox I get â=9Cimage/jpeg".
>
>
>
> Any suggestions?
>
> Thanks,
>
> ..../Ernie
>
>
>
> I remember a setting from some elsewhere IE 8 was disable set file path
> location
> by default from the options dialog. Did you enabled this already ? If not=
,
> you may give it a shoot to see than !
>
> Hope this help
>
>
> Eric,
> Regards,
>
>
>
>
>
>
--001636c92336e2e0ac047e0599f4--
Re: Upload file on IE8
am 26.01.2010 00:52:37 von Ashley Sheridan
--=-XjieBZnZd6nTuy+ROTd6
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
On Tue, 2010-01-26 at 07:33 +0800, Eric Lee wrote:
> On Tue, Jan 26, 2010 at 6:41 AM, Ernie Kemp wro=
te:
>=20
> > Good Day,
> >
> >
> >
> > Iâ=99m having an issue with IE8, when I go to load=
a file the
> > program is not filling the $_FILES['user_file']['type'] .
> >
> > When I display â=9Cecho "Start".$_FILES['pix']['ty=
pe']."End";â=9D in IE8 I get â=9CStartEndâ=9D with nothing =
in between. I expected â=9Cimage/pjpeg".
> >
> >
> >
> > On FireFox I get â=9Cimage/jpeg".
> >
> >
> >
> > Any suggestions?
> >
> > Thanks,
> >
> > ..../Ernie
> >
> >
> >
> > I remember a setting from some elsewhere IE 8 was disable set file pat=
h
> > location
> > by default from the options dialog. Did you enabled this already ? If n=
ot,
> > you may give it a shoot to see than !
> >
>=20
> > Hope this help
> >
> >
> > Eric,
> > Regards,
> >
>=20
> >
> >
> >
> >
> >
But you won't be able to guarantee every IE8 user will do this, so you
shouldn't develop the app in such a way that it needs to use the value
in the array. Also, as I've said, there isn't much point relying on this
value for any reason anyway, as it doesn't guarantee the file is
actually of that type.
Thanks,
Ash
http://www.ashleysheridan.co.uk
--=-XjieBZnZd6nTuy+ROTd6--
RE: Upload file on IE8
am 26.01.2010 01:21:26 von Ernie Kemp
------=_NextPart_000_0037_01CA9DF3.977BD7D0
Content-Type: text/plain;
charset="utf-8"
Content-Transfer-Encoding: quoted-printable
=20
=20
=20
=20
From: Ashley Sheridan [mailto:ash@ashleysheridan.co.uk]=20
Sent: January-25-10 5:53 PM
To: Ernie Kemp
Cc: 'PHP General List'
Subject: Re: [PHP] Upload file on IE8
=20
On Mon, 2010-01-25 at 17:41 -0500, Ernie Kemp wrote:
=20
Good Day,
=20
Iâ=99m having an issue with IE8, when I go to load =
a file the program is not filling the $_FILES['user_file']['type'] .
=20
When I display â=9Cecho =
"Start".$_FILES['pix']['type']."End";â=9D in IE8 I get =
â=9CStartEndâ=9D with nothing in between. I expected =
â=9Cimage/pjpeg".
=20
On FireFox I get â=9Cimage/jpeg".
=20
Any suggestions?
Thanks,
...../Ernie
=20
=20
What do the other $_FILES fields say? Are they populated correctly?
I wouldn't rely on anything sent from the browser. IE is known to send =
the mime type that matches the extension, not the contents of the file, =
and for .jpg images it sends a different mime to every other browser =
anyway, so it's pretty unreliable.=20
Thanks,
Ash
http://www.ashleysheridan.co.uk
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++=
+++
With IE8,
Using $_FILES the array results for â=98nameâ=99 has =
the name of the file but â=98typeâ=99, =
â=98tmp_nameâ=99 and â=98sizeâ=99 are blanks.
I tried enabling the â=9Cfile path locationâ=9D in IE8 =
option but the results are the same for $_FILES.=20
=20
Firefox works displays all the values in the $_FILES array.
There must be a better way. Suggestions?
Thanks,
...../Ernie
------=_NextPart_000_0037_01CA9DF3.977BD7D0--
RE: Upload file on IE8
am 26.01.2010 01:25:34 von Ashley Sheridan
--=-MZQ2KjgLEzL7lhFV4L0B
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
On Mon, 2010-01-25 at 19:21 -0500, Ernie Kemp wrote:
>=20
>=20
>=20
>=20
>=20
>=20
>=20
> From: Ashley Sheridan [mailto:ash@ashleysheridan.co.uk]=20
> Sent: January-25-10 5:53 PM
> To: Ernie Kemp
> Cc: 'PHP General List'
> Subject: Re: [PHP] Upload file on IE8
>=20
> =20
>=20
> On Mon, 2010-01-25 at 17:41 -0500, Ernie Kemp wrote:
>=20
>=20
>=20
> =20
>=20
> Good Day,
>=20
> =20
>=20
> Iâ=99m having an issue with IE8, when I go to load a=
file the program is not filling the $_FILES['user_file']['type'] .
>=20
> =20
> When I display â=9Cecho "Start".$_FILES['pix']['type=
']."End";â=9D in IE8 I get â=9CStartEndâ=9D with nothing in=
between. I expected â=9Cimage/pjpeg".
> =20
> On FireFox I get â=9Cimage/jpeg".
> =20
> Any suggestions?
> Thanks,
> ..../Ernie
> =20
>=20
>=20
>=20
> What do the other $_FILES fields say? Are they populated correctly?
>=20
> I wouldn't rely on anything sent from the browser. IE is known to send th=
e mime type that matches the extension, not the contents of the file, and f=
or .jpg images it sends a different mime to every other browser anyway, so =
it's pretty unreliable.=20
>=20
>=20
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>=20
>=20
>=20
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++=
+++
>=20
> With IE8,
>=20
> Using $_FILES the array results for â=98nameâ=99 has the=
name of the file but â=98typeâ=99, â=98tmp_nameâ=99 an=
d â=98sizeâ=99 are blanks.
>=20
> I tried enabling the â=9Cfile path locationâ=9D in IE8 opt=
ion but the results are the same for $_FILES.=20
>=20
> =20
>=20
>=20
> Firefox works displays all the values in the $_FILES array.
>=20
> There must be a better way. Suggestions?
>=20
> Thanks,
>=20
> ..../Ernie
>=20
Don't use the value. There are a few different ways in PHP to get the
mime type of a file, which it does based on the contents of the file and
not its extension. This prevents someone from uploading an executable
virus for example by just changing the last three letters of the
filename.
Have a look at fileinfo() for this sort of thing.
Thanks,
Ash
http://www.ashleysheridan.co.uk
--=-MZQ2KjgLEzL7lhFV4L0B--