You are here: Re: [PHP] File upload difference between browsers « PHP « IT news, forums, messages
Re: [PHP] File upload difference between browsers

Posted by Marek Kilimajer on 02/02/05 01:33

Graham Cossey wrote:
> I have a problem uploading a file in IE6 or Firefox1.0 but it works
> fine using Opera7.54.
>
> The problem is that I want to ensure that the file being uploaded is a
> CSV file, so I test the $_FILES['file']['type'] value.
>
> In Firefox & IE it is returned as "application/octet-stream" but in
> Opera it is returned as "text/comma-separated-values", the latter
> being what I would expect.
>
> The posting form has: enctype="multipart/form-data"
>
> Can anyone offer some advice on how I can reliably test for a valid CSV file?
>
> (At least I have some security built-in, in so much as you have to use
> Opera to upload files !!)
>

In Mozilla, you can go to Preferences -> Naviator -> Helper
Applications. Then click "New Type", fill in MIME type, description and
extension, and that should be it. And then ask everyone to do that :)

Or better don't rely on client supplied values. You can use
mime_content_type() to find out the real mime type.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация