How to change upload directory for photo gallery script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chanshaw
    New Member
    • Nov 2008
    • 67

    How to change upload directory for photo gallery script

    Ok im trying to get this to upload to the photogal directory
    But I dont want to use the directory that the script is in i want to use the photogal directory up a level

    so here's the dir structure

    maindir
    -photogal
    -scripts
    ----photogal

    i want it to use the photogal directory thats in the maindir not the on in the scripts dir.

    hope i explained that well enuff, thanks for your help.

    Code:
    <?php
    $target_path = "photogal/";
    
    $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); 
    
    if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
        echo "The file ".  basename( $_FILES['uploadedfile']['name']). 
        " has been uploaded";
    } else{
        echo "There was an error uploading the file, please try again!";
    }
    ?>
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    Code:
    $targetpath = '../photogal/';

    Comment

    • chanshaw
      New Member
      • Nov 2008
      • 67

      #3
      Thank you very much!

      Comment

      • chanshaw
        New Member
        • Nov 2008
        • 67

        #4
        thank you very much, i couldnt figure it out, good show! :D

        Comment

        Working...