SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Aug 2004
    Location
    Belgium
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Php Upload script and resize problem

    Hey Folks,

    I have this script te upload an image.
    <?php
    // In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead
    // of $_FILES.

    set_time_limit(0); // om geen timeout te hebben. (Bij grote files)

    $uploaddir = "."; // IIS kan niet om met relatieve paden, en heeft een absoluut pad op de server nodig
    $uploadfile = ".". $_FILES['userfile']['name'];

    print "<pre>";
    if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
    print "File is valid, and was successfully uploaded. ";
    print "Here's some more debugging info:\n";
    print_r($_FILES);
    }
    else {
    print "Possible file upload attack!* Here's some debugging info:\n";
    print_r($_FILES);
    }
    print "</pre>";

    ?>

  2. #2
    SitePoint Zealot
    Join Date
    Jan 2004
    Location
    Stekene, Belgium
    Posts
    110
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    And what's the problem with this script?
    Good artists copy, great artists steal (Picasso)

  3. #3
    get into it! bigduke's Avatar
    Join Date
    May 2004
    Location
    Australia
    Posts
    847
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Umm, if you set the time limit to 0 how on earth will the script ever execute ???
    And change $uploadfile = ".". $_FILES['userfile']['name']; to $uploadfile = "./". $_FILES['userfile']['name'];

    Hope this helps.


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
  •