A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: *PHP* Upload

  1. #1
    Child Prodigy Fat_N_Furry's Avatar
    Join Date
    Oct 2002
    Posts
    551

    *PHP* Upload

    Hello. Me once again. I made this script that's supposed to upload picture files to my site, but it's broken and I cannot, for the life of me, figure out what's wrong with it.

    My Code:

    Code:
    <?
    
    $file = stripslashes($file);
    /*Get rid of the slashes inserted by Flash*/
    
    echo $file;
    /*Make sure we have the correct file*/
    
    $conn = ftp_connect("*****");
    /*Connect*/
    
    ftp_login($conn, "*****", "*****");
    /*Hah!  Did you really think I was going to give you my username and password??  You fools! :D*/
    
    ftp_chdir($conn, "*****");
    /*Change the directory to the one I want realative to the root directory*/
    
    ftp_put($conn, $file, FTP_IMAGE);
    /*Upload the file*/
    
    ftp_close($conn);
    /*Close the connection*/
    
    ?>
    Thanks in advance,
    Furry
    Code:
      hobby = webDesign; waitYears(3);
      job = webDesign; this.love(job);

  2. #2
    Registered User
    Join Date
    Feb 2001
    Posts
    13,039
    Hi,

    ftp_put seems to take a local and remote file parameter, and all of these functions can be checked for error

    Musicman

  3. #3
    Child Prodigy Fat_N_Furry's Avatar
    Join Date
    Oct 2002
    Posts
    551
    Checked? How? Is there some checkcode(); function or something that I don't known about? If you mean check manually, I've already done that so much my eyes actually started to hurt, and that means a headache isn't far off.


    Thanks for your time.
    Code:
      hobby = webDesign; waitYears(3);
      job = webDesign; this.love(job);

  4. #4
    Registered User
    Join Date
    Feb 2001
    Posts
    13,039
    Hi,

    its like
    if(!($conn = ftp_connect("..."))) print "connect failed";
    for the connect. All the others return true/false, so you can write
    if(!ftp_xxx($conn, ....)) print ("xxxx failed");

    Musicman

  5. #5
    Child Prodigy Fat_N_Furry's Avatar
    Join Date
    Oct 2002
    Posts
    551
    Oh I see. Thanks, Musicman.
    Code:
      hobby = webDesign; waitYears(3);
      job = webDesign; this.love(job);

  6. #6
    Child Prodigy Fat_N_Furry's Avatar
    Join Date
    Oct 2002
    Posts
    551
    Hey! I figured out what was wrong with my script, in case anybody was curious. Nothing was wrong at all, as far as I can tell. The FTP functions are not supported by my website service provider. >: ( I'm going to call them and ask them to enable them.


    Later,
    Furry
    Code:
      hobby = webDesign; waitYears(3);
      job = webDesign; this.love(job);

  7. #7
    Huge Male Member BigFerg's Avatar
    Join Date
    Dec 2000
    Location
    Leeds, UK
    Posts
    94
    If that doesn't work - you could try using is_uploaded_file, move_uploaded_file, etc. to upload stuff: check the manual for how it works.

    Ferg
    Never criticise a man until you have walked a mile in his shoes. That way, when you DO criticise him, you're a mile away... plus you have his shoes!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center