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.
UploadiFive 1.1.1 has been released which includes a small fix for added support on touch devices including iOS 6 devices.
Can't get form submission on complete working !
  • Hi all

    This works FINE:

    <html>
    <head>
    <link href="/uploadify/uploadify.css" type="text/css" rel="stylesheet" />
    <script type="text/javascript" src="/uploadify/jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="/uploadify/swfobject.js"></script>
    <script type="text/javascript" src="/uploadify/jquery.uploadify.v2.1.4.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function() {
    $('#file_upload').uploadify({
    'uploader' : '/uploadify/uploadify.swf',
    'script' : 'uploadify.php',
    'cancelImg' : '/uploadify/cancel.png',
    'folder' : 'uploads',
    'multi' : true
    });
    });
    </script>
    </head>
    <body>
    <input type="file" id="file_upload" name="file_upload" />
    <a href="javascript:$('#file_upload').uploadifyUpload();">Upload Files</a>
    </body>
    </html>


    This doesn't work at all:

    <html>
    <head>
    <link href="/uploadify/uploadify.css" type="text/css" rel="stylesheet" />
    <script type="text/javascript" src="/uploadify/jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="/uploadify/swfobject.js"></script>
    <script type="text/javascript" src="/uploadify/jquery.uploadify.v2.1.4.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function() {
    $('#file_upload').uploadify({
    'uploader' : '/uploadify/uploadify.swf',
    'script' : 'uploadify.php',
    'cancelImg' : '/uploadify/cancel.png',
    'folder' : 'uploads',
    'multi' : true,
    'onAllComplete' : function(event,data) {
    document.getElementByID('someForm').submit();
    }

    });
    });
    </script>
    </head>
    <body>
    <form id="someForm" action="someFile.php" method="post">
    <input name="someField" type="text" />
    <input id="someID" name="someName" type="file" />
    <input onclick="$('#someID').uploadifyUpload()" type="button" value="Submit" />
    </form>
    </body>
    </html>


    The page isn't displayed correctly and I get an error on submit:

    Message: 'document.getElementById(...)' is null or not an object
    Line: 26
    Char: 6661
    Code: 0

    Can anyone help, please?
  • Got a bit further. This form works - the file is uploaded, but the form is not submitted.



    Does anyone have any suggestions?


    <html>
    <head>
    <link href="/uploadify/uploadify.css" type="text/css" rel="stylesheet" />
    <script type="text/javascript" src="/uploadify/jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="/uploadify/swfobject.js"></script>
    <script type="text/javascript" src="/uploadify/jquery.uploadify.v2.1.4.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function() {
    $('#file_upload').uploadify({
    'uploader' : '/uploadify/uploadify.swf',
    'script' : 'uploadify.php',
    'cancelImg' : '/uploadify/cancel.png',
    'folder' : 'uploads',
    'multi' : true,
    'onAllComplete' : function() {
    document.getElementByID('someForm').submit();
    }

    });
    });
    </script>
    </head>
    <body>
    <form id="someForm" action="somefile.php" method="post">
    <input name="someField" type="text" />
    <input id="file_upload" name="someName" type="file" />
    <input onclick="$('#file_upload').uploadifyUpload()" type="button" value="Submit" />
    </form>
    </body>
    </html>
  • document.getElementByID('someForm').submit();


    "SOMEFORM" = #YOURFORMID

    document.getElementByID('#FORM-ID').submit();

    Try that ;-) (obviously substitute #FORM-ID with your ACTUAL FORM ID. Put the # sign first then the ID)
  • Thanks for your help! In the example I showed, the formID IS 'someForm' (for ease of testing).

    I've modified the script to use another formID for clarity and I've also added the # at the start of the ID.



    Same thing happens; the file uploads OK but the form is still not submitted!

    Any more ideas, anyone? Here's the code as it is now. The action file 'somefile.php' does exist; it simply prints 'done' then exits, as a test for now. The uploadify script is the one provided, but with an added echo right at the end, as I read elsewhere in the forums that an echo is sometimes required.


    <html>
    <head>
    <link href="/uploadify/uploadify.css" type="text/css" rel="stylesheet" />
    <script type="text/javascript" src="/uploadify/jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="/uploadify/swfobject.js"></script>
    <script type="text/javascript" src="/uploadify/jquery.uploadify.v2.1.4.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function() {
    $('#file_upload').uploadify({
    'uploader' : '/uploadify/uploadify.swf',
    'script' : 'uploadify.php',
    'cancelImg' : '/uploadify/cancel.png',
    'folder' : 'uploads/',
    'multi' : true,
    'onAllComplete' : function() {
    document.getElementByID('#testform').submit();
    }

    });
    });
    </script>
    </head>

    <body>
    <form id="testform" action="somefile.php" method="post">
    <input name="someField" type="text" />
    <input id="file_upload" name="someName" type="file" />
    <input onclick="$('#file_upload').uploadifyUpload()" type="button" value="Submit" />
    </form>
    </body>
    </html>



  • Fixed it! The solution was to remove document.getElementByID.

    The working form looks like this:


    <html>
    <head>
    <link href="/uploadify/uploadify.css" type="text/css" rel="stylesheet" />
    <script type="text/javascript" src="/uploadify/jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="/uploadify/swfobject.js"></script>
    <script type="text/javascript" src="/uploadify/jquery.uploadify.v2.1.4.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function() {
    $('#file_upload').uploadify({
    'uploader' : '/uploadify/uploadify.swf',
    'script' : 'uploadify.php',
    'cancelImg' : '/uploadify/cancel.png',
    'folder' : 'uploads/',
    'multi' : true,
    'onAllComplete' : function() {
    $('#testform').submit();
    }

    });
    });
    </script>
    </head>

    <body>
    <form id="testform" action="somefile.php" method="post">
    <input name="someField" type="text" />
    <input id="file_upload" name="someName" type="file" />
    <input onclick="$('#file_upload').uploadifyUpload()" type="button" value="Submit" />
    </form>
    </body>
    </html>


    It might be worth someone updating the documentation if this is the correct way to do it.

    Thanks
  • I found Christian Louboutin Sale discount here with good price.And I so happy to get Christian Louboutin Slingback looks so fashion.Christian Louboutins hot sale now.Don't miss it.
  • Hi i also want to use the option to to go to other PHP script now .
    I want to know once the form is submitted and control goes to PHP script then how can we get the names of the files uploaded in PHP script so that i can save them in database???


    Please help
  • Hi Rohit 5145

    You can get the file name as follows, if your file field name is 'myfiles' try to do the following:
    (this example assumes you are uploading 1 file)

    $myFileName = $_FILES['myfiles']['name'];
    echo $myFileName;


    cheers
  • The user and all related content has been deleted.
  • The actual error is that it should be getElementById and not getElementByID
    ie. lower case d at the end.
    I think the FAQs should be amended to show this