Upload failure

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • memermore
    New Member
    • Sep 2007
    • 15

    #1

    Upload failure

    here is my code that is supposed to upload files and save it to web server but somehow didn't work. Please help. I'm new in php and I'm using version 4

    $thumb_loc = "../Folders/".$myfolder ."/";
    $thumb_loc = $thumb_loc.base name($myfile);
    if (!file_exists($ thumb_loc)){

    if (move_uploaded_ file($myfile,$t humb_loc)){
    echo "<script language='javas cript'> location.href=' default.php?mes sage=File uploaded&method =list';</script>";
    }
    else{
    echo "<script language='javas cript'> location.href=' default.php?mes sage=Uploading failed&method=l ist';</script>";
    }
    }
    else{
    echo "<script language='javas cript'> location.href=' default.php?mes sage=File already exists&method=l ist';</script>";
    }
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    What happens and what doesnt happen?
    What is $myfile?

    try this tutorial.

    Comment

    Working...