Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: file upload

  1. #1
    Regular Coder
    Join Date
    Jan 2004
    Location
    Georgia
    Posts
    306
    Thanks
    0
    Thanked 0 Times in 0 Posts

    file upload

    This code uploads the file to the path specified AND in the same directory as the script. I dont want it in the directory with the script, just the file path specified. Let me know whats up with it. Thanks.


    Code:
    copy($HTTP_POST_FILES['avatar'] ['tmp_name'],
    $HTTP_POST_FILES['avatar'] ['name']);
    copy("$avatar",  "/var/www/html/forum/avatars/$username.gif");
    ~Designer's Toolz~

  • #2
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,106
    Thanks
    11
    Thanked 101 Times in 99 Posts
    not knowing what $avatar is this is a guess.
    PHP Code:
    <?php
    copy
    (
        
    $HTTP_POST_FILES['avatar'] ['tmp_name'],
        
    "/var/www/html/forum/avatars/$username.gif"
    );
    ?>
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #3
    Regular Coder
    Join Date
    Jan 2004
    Location
    Georgia
    Posts
    306
    Thanks
    0
    Thanked 0 Times in 0 Posts
    $avatar is on the previous page before the one with the upload code; it is the name of a file input type.
    ~Designer's Toolz~


  •  

    Posting Permissions

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