Resize photos

Discussion in 'PHP' started by jonyBravo, Jul 19, 2007.

  1. #1
    Hi there

    I'm doing for the first time a php project for my work. This project involve php and flash but I'm having some problems.
    I've found the following code to upload photos:
    <?php
    //create the directory if doesn't exists (should have write permissons)
    if(!is_dir("./files")) mkdir("./files", 0755);
    //move the uploaded file
    move_uploaded_file($_FILES['Filedata']['tmp_name'], "./files/".$_FILES['Filedata']['name']);
    chmod("./files/".$_FILES['Filedata']['name'], 0777);
    ?>

    The problem is I need to change the name and the size of the uploaded photos.

    Is there anyone that can help me please?
     
    jonyBravo, Jul 19, 2007 IP
  2. mrmonster

    mrmonster Active Member

    Messages:
    374
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    60
    #2
    To work with images you need to use some image library like GD or ImageMagick

    Chances are your hosting has GD installed, you can verify by looking at the output of phpinfo()

    http://php.net/gd
     
    mrmonster, Jul 19, 2007 IP