Re: how to recognize CSV file?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 19, 2008 at 2:59 PM, Afan Pasalic <afan@xxxxxxxx> wrote:
> hi,
> I have form where administrator has toupload csv file to update dome
> data in mysql.
> I was trying to validate entered file but got some crazy stuff I don't
> understand:
>
> for the same uploaded csv file, in different browser I'll get different
> results:
>
> Windows machine and IE: $_FILES['UploadedFile']['type'] = 'text/plain'
> Windows machine and Firefox: $_FILES['UploadedFile']['type'] =
> 'application/octet-stream'
> Windows machine and Opera: $_FILES['UploadedFile']['type'] =
> 'comma-separated-values'
> Windows machine and Chrome: $_FILES['UploadedFile']['type'] = ''
> (doesn't show anything! empty?!?!!??)
> openSuse machine and Firefox: $_FILES['UploadedFile']['type'] = 'text/csv'
> openSuse machine and Opera: $_FILES['UploadedFile']['type'] =
> 'text/comma-separated-values'
> openSuse machine and Konqueror: $_FILES['UploadedFile']['type'] = 'text/csv'
>
> ok. what's CORRECT way to validate uploaded file?
>
> thanks.
>
> -afan


Get the mime type of the uploaded tmp file, no what the browser sends.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux