Need some advice/help sending images from site to ftp

Discussion in 'PHP' started by webtracker, Nov 17, 2006.

  1. #1
    2 Q's

    1. How can I open an FTP session to send images from my web site to a remote server using PHP - I'd like to do this to upload images using a ADMIN of sorts.

    I thought I could use this:

    ftp://username:pass@ftp.someremotesite.com

    2. Also, when I do send the file (via a browse button I hope) how can I keep the PHP from changing the name of the file and respecting the actual filename.

    I'm not all that familiar with PHP but this is the line of code that exists in my site right now to create the name:

    $img_id= "i".$num.strtoupper(substr(md5(uniqid(microtime(), true)), 0, 5));

    The code to upload it to out local site DB is:

    if ( move_uploaded_file($_FILES['thumbnail']['tmp_name'], "www.outlocalserver.com/userpics/{$subdir}{$img_upload}") )

    Thanks...
     
    webtracker, Nov 17, 2006 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
  3. webtracker

    webtracker Peon

    Messages:
    108
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    webtracker, Nov 18, 2006 IP