[TYPO3] PHP help ! does this code look like it would check a file extensions, and disallow php files or exe files to be attached

Rens Admiraal typo3 at ambitiondesign.nl
Thu Jun 14 16:34:50 CEST 2007


Dave,

Dmitry is trying to say the $_POST array will not contain the actual  
file, but you have to use the $_FILES array, in Typo3 you could use  
functions like t3lib_div::upload_to_tempfile or  
t3lib_div::upload_copy_move. More information about this functions is  
in the Typo3 class reference

It is possible my code did not work because I gave an example of how  
you could work with mimetypes, but did not test the code itself.


Op 14-jun-2007, om 16:06 heeft Dmitry Dulepov het volgende geschreven:

> Rens Admiraal wrote:
>> The code below is correct... If you want the right mime types you can
>> search google...
>
> Also _POST('filename')?
>
>>> <?php
>>>        $allowed = array(    'file/pdf' ,
>>>                                                'file/doc',
>>>                                                'file/xls',
>>>                                                'file/ppt'
>>>        );
>>>
>>>        if (in_array(filetype(t3lib_div::_POST('filename'),  
>>> $allowed) {
>
> -- 
> Dmitry Dulepov
> TYPO3 freelancer / TYPO3 core team member
> Web: http://typo3bloke.net/
> Skype: callto:liels_bugs
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english



More information about the TYPO3-english mailing list