SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Formerly known as RockNRollPig Shpigford's Avatar
    Join Date
    Dec 2002
    Location
    Denver, CO
    Posts
    2,877
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how would i rename $_FILES['userfile']['name']

    I've just about figure out filed uploading. I've used
    PHP Code:
    if(move_uploaded_file($_FILES['userFile']['tmp_name'], "/home/beloved/public_html/arcadearena/images/" "/"$_FILES['userfile']['name'
    to move the uploaded image to a specific directory but I would like to rename the file to a unique name when it gets moved. The way i figured would be easiest would be to some how rename
    PHP Code:
    $_FILES['userfile']['name'
    any ideas?

  2. #2
    SitePoint Addict shad0w's Avatar
    Join Date
    Aug 2003
    Location
    PA
    Posts
    239
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    rename();

    From the manual:
    PHP Code:
     <?php
    rename
    ("/tmp/tmp_file.txt""/home/user/login/docs/my_file.txt");
    ?>

  3. #3
    SitePoint Enthusiast Deo's Avatar
    Join Date
    Oct 2003
    Location
    Washington, USA
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just dont try to use rename() for copying files across partitions unless your running 4.3.3+


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •