Menu

Uploading&renaming files,preserving extension

Help
2004-03-02
2013-04-23
  • forresto.com

    forresto.com - 2004-03-02

    Here is question my #2:

    I want to rename uploaded files with data entered into the forms. File extension should remain the same, but spaces and illegal characters would convert to _.

    Any suggestions for starting places with this?

     
    • Ilya Boyandin

      Ilya Boyandin - 2004-06-29

      I'm not quite sure I've understood the problem. But you can extends FPFile and override the setValue() method in it so that it updates $this->_destinationFile in the way you need. To convert the names I think you should use regular expressions (see preg_replace(...)) .

       
    • Emil  Stoyanov

      Emil Stoyanov - 2008-09-11

      I am trying to change uploaded files with data entered into the forms but not work.
      "allowable_content_types" => array('image/gif')

      I have change with - jpg, bmp or other file types.

      I try with "allowable_content_types" => array('image/gif','image/png','image/bmp')
      but not work

      Any suggestions for starting places with this?

       

Log in to post a comment.