Howdy, Stranger!

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

Dynamic folder selection
  • What I try to do is to link a SELECT form to the path folder of uploadify. Here is my code...



    <script language='javascript'>
    function choix(texte)
    {
    if (texte==\"maitre\"){

    }
    if (texte==\"eleves\"){

    }
    if (texte==\"vernissage\"){

    }
    }
    </script>


    <FORM ACTION=\"\" name=\"formulaire\">

    <SELECT name=\"fonction\" onchange=\"choix(this.value)\"\">
    <OPTION selected VALUE=\"vide\">...</OPTION>
    <OPTION VALUE=\"maitre\">Maitre</OPTION>
    <OPTION VALUE=\"eleves\">Eleves</OPTION>
    <OPTION VALUE=\"vernissage\">Vernissage</OPTION>
    </SELECT>
    </FORM>
    <br/>


    <link href=\"/include/uploadify/uploadify.css\" rel=\"stylesheet\" type=\"text/css\" />
    <script type=\"text/javascript\" src=\"./include/uploadify/swfobject.js\"></script>
    <script type=\"text/javascript\" src=\"./include/uploadify/jquery.uploadify.v2.1.0.js\"></script>
    <script type=\"text/javascript\">
    $('#uploadify').uploadify({
    'uploader': './include/uploadify/uploadify.swf',
    'script': './include/uploadify/uploadify.php',
    'folder': '../images/',
    'fileDesc':'Images',
    'auto' : true,
    'multi' : true,
    'fileExt':'*.jpg;*.jpeg',
    'queueID' : 'fileQueue',
    'cancelImg': './include/uploadify/cancel.png'
    });

    </script>

    <div id=\"fileQueue\" style=\"width:300px;height:250px;border:1px solid #E5E5E5;padding: 0;overflow:auto;margin-bottom: 10px;\">&amp;nbsp;</div>
    <input type=\"file\" name=\"uploadify\" id=\"uploadify\" />



    But as you can see, I don't have any idea of how doing this...

    In advance think you and sorry for my english T_T'
  • Finaly, i found a way...

    Here my code for interested people.



    <FORM ACTION=\"\" name=\"formulaire\">

    <SELECT name=\"fonction\" onchange=\"choix(this.value)\"\">
    <OPTION selected VALUE=\"...\">...</OPTION>
    <OPTION VALUE=\"maitre\">Maitre</OPTION>
    <OPTION VALUE=\"eleves\">Eleves</OPTION>
    <OPTION VALUE=\"vernissages\">Vernissage</OPTION>
    </SELECT>
    </FORM>
    <br/>


    <link href=\"/include/uploadify/uploadify.css\" rel=\"stylesheet\" type=\"text/css\" />
    <script type=\"text/javascript\" src=\"./include/uploadify/swfobject.js\"></script>
    <script type=\"text/javascript\" src=\"./include/uploadify/jquery.uploadify.v2.1.0.js\"></script>
    <script type=\"text/javascript\">

    function choix(texte)
    {

    if (texte==\"maitre\"){
    $.get('param_image.php', {
    dossier:texte
    }, function(data){
    //load content in 'upload' div
    $('#upload').html(data);
    });

    }
    if (texte==\"eleves\"){
    $.get('param_image.php', {
    dossier:texte
    }, function(data){
    load content in 'upload' div
    $('#upload').html(data);
    });
    }
    if (texte==\"vernissages\"){
    $.get('param_image.php', {
    dossier:texte
    }, function(data){
    load content in 'upload' div
    $('#upload').html(data);
    });
    }
    }
    </script>
    <div id=\"upload\"></div>



    In param_image.php



    <?php

    echo '<script type=\"text/javascript\">';
    echo \"$('#uploadify').uploadify({\";
    echo \" 'uploader' : './include/uploadify/uploadify.swf',\";
    echo \" 'script' : './include/uploadify/uploadify.php',\";
    echo \" 'folder' : '../images/\".$_GET['dossier'].\"',\";
    echo \" 'fileDesc' :'Images',\";
    echo \" 'auto' : true,\";
    echo \" 'multi' : true,\";
    echo \" 'fileExt' :'*.jpg;*.jpeg',\";
    echo \" 'queueID' : 'fileQueue',\";
    echo \" 'cancelImg' : './include/uploadify/cancel.png'\";
    echo \"});\";
    echo \"</script>\";

    echo \"<input type='file' name='uploadify' id='uploadify' />\";
    echo '<div id=\"fileQueue\" style=\"width:300px;height:250px;border:1px solid #E5E5E5;padding: 0;overflow:auto;margin-bottom: 10px;\">&amp;nbsp;</div>';

    ?>