You may use mime_content_type to get the filetype of a file, this is now depreciated for later versions of PHP in which it is best to use Fileinfo.
mime_content_type: http://uk.php.net/manual/en/function.mime-content-type.php Fileinfo: http://uk.php.net/manual/en/ref.fileinfo.php Hope this helps On 1 December 2010 10:57, Miqdad Ali <[email protected]> wrote: > thank you 4 ur help > > but,i don't know which type of file user will upload , so i want to > download file which user uploaded my be pdf ,doc or any image > > -------------------------------------------------------------------- > Miqdad Ali > http://www.miqdadali.co.cc > > > > > On Tue, Nov 30, 2010 at 2:37 PM, Stephen > <[email protected]>wrote: > >> If you mean you want to your users to be prompted with a download window >> use readfile, otherwise I don't think I understand the question. >> >> Here's something I did for pdf files. >> >> http://pastie.org/private/igu2zad2lasz4vjowvdya >> >> >> >> On 29 November 2010 06:42, Miqdad Ali <[email protected]> wrote: >> >>> friends, >>> I want code for downloading image files in cakephp >>> -------------------------------------------------------------------- >>> Miqdad Ali >>> http://www.miqdadali.co.cc >>> >>> >>> Check out the new CakePHP Questions site http://cakeqs.org and help >>> others with their CakePHP related questions. >>> >>> You received this message because you are subscribed to the Google Groups >>> "CakePHP" group. >>> To post to this group, send email to [email protected] >>> To unsubscribe from this group, send email to >>> [email protected]<cake-php%[email protected]>For >>> more options, visit this group at >>> http://groups.google.com/group/cake-php?hl=en >>> >> >> >> >> -- >> Kind Regards >> Stephen >> www.ninjacodermonkey.co.uk >> >> >> Check out the new CakePHP Questions site http://cakeqs.org and help >> others with their CakePHP related questions. >> >> You received this message because you are subscribed to the Google Groups >> "CakePHP" group. >> To post to this group, send email to [email protected] >> To unsubscribe from this group, send email to >> [email protected]<cake-php%[email protected]>For >> more options, visit this group at >> http://groups.google.com/group/cake-php?hl=en >> > > Check out the new CakePHP Questions site http://cakeqs.org and help > others with their CakePHP related questions. > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected]<cake-php%[email protected]>For > more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > -- Kind Regards Stephen @ NinjaCoderMonkey www.ninjacodermonkey.co.uk Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
