Menu

Rename upload files

Help
astro
2007-07-03
2013-06-03
  • astro

    astro - 2007-07-03

    ok so pretty standard form, if got an the persons name in a field, and then down the bottom got an upload file field. first things first i would like to be able to rename the file uploaded to the name supplied earlier, and also most likely it will have spaces in the name. this is causeing a problem currently where the link to the file in the email that is sent wont work because of the spaces. now the person who gets these emails isnt the most techy so i need a way that when the file is renamed its also uploaded so there are no spaces.

     
    • beanwl

      beanwl - 2007-07-09

      I'm having the same problem....this some of the code in process.php:
      --------------------------------------------------------------------------
      $image_part = date("h_i_s")."_".$HTTP_POST_FILES['HeadPhoto']['name'];
      $image_list[23] = $image_part;
      copy($HTTP_POST_FILES['HeadPhoto']['tmp_name'], "files/".$image_part);
      $image_part = date("h_i_s")."_".$HTTP_POST_FILES['StopPhoto']['name'];
      $image_list[24] = $image_part;
      copy($HTTP_POST_FILES['StopPhoto']['tmp_name'], "files/".$image_part);
      $where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));

      76: Head Photo: ".$where_form_is."files/".$image_list[23]."
      77: Stop Photo: ".$where_form_is."files/".$image_list[24]."
      --------------------------------------------------------------------------------

      I need the photo to upload with it's orginal name without the server time stamp.  Any clues? on what to add/remove???

      Thanks,

      beanwl

       
      • TNTEverett

        TNTEverett - 2007-07-09

        It is not practivcal to omit the time stamp.  The time stamp distinguishes different users as well as the same user attempting to upload a document of the same name.  If you wish to allow this possibility then you can remove the timestamp feature at your own risk. 

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.