Sorry... I can't deal with all the SPAM so until I can find a better solution for the forums, I'm locking them down. For now please use awesome services like stackoverflow.com for community support. Thanks.
This forum is a community forum meant for users of the plugin to collaborate and help solve issues with implementation, etc. Unfortunately, as the creator of the plugin, I do not have much time to attend to every request here as this is only a side project and I must work a full-time job to provide for my family. This is how I keep the Flash version free and the HTML5 version low cost.
Uploadify with FTP Tranfert
  • Hello, i'm a french developper.

    I use the jquery script Uploadify to upload on a web server. All is OK!

    I use too a script witch select a file and transfert it on my FTP server.

    Look at this code :

    $ftp_user_name="login";
    $ftp_user_pass="password";
    $source_file="C:\Documents and Settings\NAME\Bureau\SERVER-2nd5778.pdf";
    $destination_file="/FOLDER1/FOLDER2/FOLDER3/SERVER-2nd5778.pdf";

    $conn_id = ftp_connect("ftp.sitename.fr");

    $login_result = ftp_login($conn_id, "$ftp_user_name", "$ftp_user_pass");

    if ((!$conn_id) || (!$login_result)) {
    echo "La connexion FTP a échoué!";
    echo "Tentative de connexion à $ftp_server avec $ftp_user_name";
    die;
    } else {
    echo "$ftp_user_name";
    }

    $upload = ftp_put($conn_id, "$destination_file", "$source_file", FTP_BINARY);

    if (!$upload) {
    echo "Le téléchargement Ftp a échoué!";
    } else {
    echo "Téléchargement de $source_file - $destination_file";
    }

    ftp_quit($conn_id);


    All is ok too!

    I would like to remplace the upload.php of uploadify by my ftp script.

    Here :

    if (!empty($_FILES)) {
    $tempFile = $_FILES['Filedata']['tmp_name'];
    $targetPath = $_SERVER['DOCUMENT_ROOT'] . $_GET['folder'] . '/';
    $targetFile = str_replace('//','/',$targetPath) . $_FILES['Filedata']['name'];

    // Uncomment the following line if you want to make the directory if it doesn't exist
    // mkdir(str_replace('//','/',$targetPath), 0755, true);

    move_uploaded_file($tempFile,$targetFile);
    }
    echo "1";


    by
    if (!empty($_FILES)) {
    $ftp_user_name="login";
    $ftp_user_pass="password";
    $source_file="C:\Documents and Settings\NAME\Bureau\SERVER-2nd5778.pdf";
    $destination_file="/FOLDER1/FOLDER2/FOLDER3/SERVER-2nd5778.pdf";

    $conn_id = ftp_connect("ftp.sitename.fr");

    $login_result = ftp_login($conn_id, "$ftp_user_name", "$ftp_user_pass");

    if ((!$conn_id) || (!$login_result)) {
    echo "La connexion FTP a échoué!";
    echo "Tentative de connexion à $ftp_server avec $ftp_user_name";
    die;
    } else {
    echo "$ftp_user_name";
    }

    $upload = ftp_put($conn_id, "$destination_file", "$source_file", FTP_BINARY);

    if (!$upload) {
    echo "Le téléchargement Ftp a échoué!";
    } else {
    echo "Téléchargement de $source_file - $destination_file";
    }

    ftp_quit($conn_id);
    echo "1";


    But it doesn't work.

    Can you help me? Thank a lot!
  • your missing the enclosing } bracket to the if(!empty($_FILES))
  • Thank, but i miss this when i write the post. In my file it's was ok.
  • I found the problem, it was about the source of file. Thanks for help
  • Tried to implement but have some issues:

    What code do you use to translate the source file for a person uploading from a computer?
    $source_file="C:\Documents and Settings\NAME\Bureau\SERVER-2nd5778.pdf";

    I am trying to load onto the main folder of a FTP server. Should I leave this blank?
    $destination_file="/FOLDER1/FOLDER2/FOLDER3/SERVER-2nd5778.pdf";

    I've been reading that you can't use an ip address for a ftp_connect(""). If we don't have a domain name will we not be able to make this work?
  • The user and all related content has been deleted.