home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Freeware / Programare / groupoffice-com-2.01 / controls / icon.php < prev    next >
PHP Script  |  2004-03-08  |  988b  |  30 lines

  1. <?php
  2. /*
  3. Copyright Intermesh 2003
  4. Author: Merijn Schering <mschering@intermesh.nl>
  5. Version: 1.0 Release date: 08 July 2003
  6.  
  7. This program is free software; you can redistribute it and/or modify it
  8. under the terms of the GNU General Public License as published by the
  9. Free Software Foundation; either version 2 of the License, or (at your
  10. option) any later version.
  11. */
  12.  
  13. require("../Group-Office.php");
  14.  
  15. //load filetypes management class
  16. require($GO_CONFIG->class_path."filetypes.class.inc");
  17. $filetypes = new filetypes();
  18. $mime = isset($_REQUEST['mime']) ? $_REQUEST['mime'] : '';
  19. if(!$filetype = $filetypes->get_type($_REQUEST['extension'], true))
  20. {
  21.     $filetype = $filetypes->add_type($_REQUEST['extension'], $mime,'','',true);
  22. }
  23.  
  24. header("Cache-Control: max-age=2592000\n");
  25. header("Content-type: image/gif\n");
  26. header("Content-Disposition: filename=".$filetype['extension'].".gif\n");
  27. header("Content-Transfer-Encoding: binary\n");
  28. echo $filetype['image'];
  29. ?>
  30.