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.
setting scriptData after initialization
  • Greetings,

    great plugin. I love it to death.

    Heres my issue, I am uploading large video files to my server, in that process I would like to capture a title and a description as well. In my form I have 2 text fields and a file field. Here is my js code.

    	<script type=\"text/javascript\" charset=\"utf-8\">
    $(function(){
    $(\"#_video_file\").uploadify({
    'uploader' : '/uploadify/uploadify.swf',
    'script' : '/uploadify/uploadify.php',
    'cancelImg' : '/uploadify/cancel.png',
    'folder' : '/manager/video-uploads',
    'fileExt' : '*.wmv;*.mov;*.mpg;*.avi;*.jpg',
    'sizeLimit': 50971520,
    'multi' : false,
    'onComplete' : function( ev,qID,fObj,res,data ){
    r = eval('(' + res + ')');
    alert( res.title );
    alert( res );
    alert( r );
    alert( r.title );
    alert( r.description );
    }
    });
    $(\"#doUpload\").click( function(){
    title = ( $(\"#_title\").val() == \"\" ) ? \"\" : $(\"#_title\").val() ;
    description = ( $(\"#_description\").val() == \"\" ) ? \"\" : $(\"#_description\").val() ;
    $(\"#_video_file\").uploadifySettings({
    'scriptData' : { 'title' : title , 'description' : description }
    });
    $(\"#_video_file\").uploadifyUpload();
    return false;
    });
    });
    </script>


    Everything works perfect except I am not able to access my scriptData( title, description ) in the uploadify.php. Any help would be greatly appreciated.
  • Are you using $_POST or $_GET to check your scriptData values in uploadify.php? The default behavior changed from $_GET to $_POST with the new release. I don't believe the examples have been updated to reflect this change. You need to reference passed scriptData via $_POST unless you use set the 'method' option to 'GET'.
  • If your ever unsure if GET or POST is being used, you can always use $_REQUEST instead.
  • I have tried _POST and _REQUEST but neither are working.

    The top of my php:
    <?php
    include $_SERVER['DOCUMENT_ROOT'].\"/include/lib.php\";
    echo json_encode( $_REQUEST );
    die;


    i then alert this in the onComplete:
    {\"Filename\":\"kobe.jpg\",\"fileext\":\"*.wmv;*.mov;*.mpg;*.avi;*.jpg\",\"folder\":\"\/manager\/video-uploads\",\"Upload\":\"Submit Query\"}


    neither my title nor description are appearing. I am rather baffled.
  • $(\"#_video_file\").uploadifySettings({
    'scriptData' : { 'title' : title , 'description' : description }
    });


    is my syntax here correct?

    uploadifySettings( { 'scriptData' : { 'title' : title , 'description' : description } } ) ;
  • I've found the solution

    incorrect syntax
    uploadifySettings( { 'scriptData' : { 'title' : title , 'description' : description } } ) ;



    correct syntax
    uploadifySettings( 'scriptData' , { 'title' : title , 'description' : description } ) ;

Howdy, Stranger!

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