Results 1 to 3 of 3

Thread: File Upload Issue

  1. #1
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default File Upload Issue

    This script:
    Code:
    <?php
    $target_path = "ftp://****:****@oriosisedge.infinites.net/comics/$_POST[shortFile]";
    
    $target_path = $target_path . basename( $_FILES['uploadedfile']['']); 
    
    if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
        echo "The file ".  basename( $_FILES['uploadedfile']['']). 
        " has been uploaded";
    } else{
        echo "There was an error uploading the file, please try again!";
    }
    ?>
    Won't work. Although, without the red part, it works fine. What I'm aiming to do is to be able to upload a file from the users pc to another ftp server.
    - Mike

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Ermm... I don't think that ftp works like that in PHP. In fact, i'm sure it doesn't.

    Look up the FTP functions for php:
    http://www.php.net/manual/en/ref.ftp.php

    Also, using the user:pass@ftp format might not work, since php needs a specific format for the ftp connect function.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Yeah, I was actually looking at the php.net documentation, and found that it didn't help much. Then I found a link posted by Twey through searching the forums, which led me to exactly what I needed. I got it to work on my own ftp directory, but I wanted to export to an alternate directory (it has 100 megs of space, so I post all my images there). I guess using that method won't work.
    I also thought about the root thingy:
    user/mburt/...
    I'm wondering if I could use that in place of the ftp url?
    - Mike

Bookmarks

Posting Permissions

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