Re: Uploading and verifying word and excel files

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

 



Jack Jackson wrote:
<snip>
So my questions:
1. How do you validate Word and Excel files before upload?



Before? JavaScript...if JavaScript can even do it (I haven't touched the stuff in ages). After upload, you can check the mime type, but that's not foolproof.


Okay, sorry I miswrote: after upload to the temp directory, BEFORE using move_uploaded_file(). Checking the mime type is the problem - if I can't trust the browsers am I really reliant on the file extension? Can't I peek in some manner into it as we do with getimagesize()?

If your version of php has been configured with it, you can use mime_content_type()

http://us3.php.net/manual/en/function.mime-content-type.php

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john@xxxxxxxxxxxx

--
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