Welcome to the new Uploadify Community Forums. We've made the switch from PHPBB to Vanilla Forums in hopes of controlling the SPAM more efficiently. We hope this change doesn't suck so much. Also, don't forget to wrap your code in tags. You can quickly insert code using ctrl + f.
I lost some messages that were posted on February 4th. If you posted a message or reply on February 4th, please do so again. Sorry about the inconvenience.
Uploadify hangs after completing
  • Sup peeps,

    First, this is one piece of my form code :


    $(document).ready(function() {
    $('#fileInput').fileUpload ({
    'uploader': 'uploadify/uploader.swf',
    'cancelImg': 'uploadify/cancel.png',
    'script': 'uploadify/upload.php',
    'folder': 'files',
    'multi': false,
    'buttonText': 'Select Files',
    'checkScript': 'uploadify/check.php',
    'displayData': 'speed',
    onComplete: function(event, queueID, fileObj, response, data) {
    $('#uploadhidden').val(fileObj.name);
    document.cform.submit();

    }
    });
    });


    Secondly, upload.php

    Default :

    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";


    the page works nice, when the upload completed the form is submit ;) ,

    But now I want to upload by ftp : new upload.php


    if (!empty($_FILES)) {
    <?php<br /> set_time_limit(1000);
    $ftp_user_name='test';
    $ftp_user_pass='test';
    $paths='website_upload';

    $source_file=$_FILES['Filedata']['tmp_name'];
    $destination_file=$_FILES['Filedata']['name'];

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

    if ((!$conn_id) || (!$login_result)) {
    echo "FTP fail!";
    echo "Connect to ";
    exit;
    } else {
    echo "";
    }

    $upload = ftp_put($conn_id, $paths.'/'.$destination_file, "$source_file", FTP_BINARY);

    if (!$upload) {
    echo "FTP upload has encountered an error!";
    } else {
    echo "Your upload is completed : $name.";
    }

    ftp_quit($conn_id);


    }
    echo "1";
    ?>

    With this script the progress bar works you see the file uploading by ftp but when is completed the form hangs without submit :

    onComplete: function(event, queueID, fileObj, response, data) {
    $('#uploadhidden').val(fileObj.name);
    document.cform.submit();


    but when I check the ftp server the file is there :?

    So can someone help me so when the upload is finish the onComplete (submit) works.

    Thx in advance for the help.
    peace
  • I did some testing and uploadify don't hangs if the file uploaded is smaller then a 1mb :?

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!