Keysersoze Keysersoze - 6 months ago 40
Javascript Question

PlUpload : select folders feature

Thanks to PlUpload library, I would like to upload folder through window dialog.

It's possible and explained here. (search for "select_folder").

Nevertheless, there is no explanations in PlUpload website.

<html>
<head>
</head>

<body>
<ul id="filelist"></ul>
<br />

<div id="container">
<a id="browse" href="javascript:;">[Browse...]</a>
<a id="start-upload" href="javascript:;">[Start Upload]</a>
</div>


<script type="text/javascript" src="./js/plupload.full.min.js" ></script>
<script type="text/javascript">
var uploader = new plupload.Uploader({
browse_button: 'browse', // this can be an id of a DOM element or the DOM element itself
url: 'upload.php',
select_folder:1,
drag_and_drop:0
});

uploader.init();
</script>
</body>




This code does not work. So, what is the problem with it?

Thanks in advance :)

Have a good day.

Answer

I had to use a Moxie object.

        <body>
            <ul id="filelist"></ul>
            <br />

            <div id="container">
                <a id="browse" href="javascript:;">[Browse...]</a>
                <a id="start-upload" href="javascript:;">[Start Upload]</a>
            </div>


            <script type="text/javascript" src="./js/plupload.full.min.js" ></script>
            <script type="text/javascript">
                var uploader = new plupload.Uploader({
                  url: 'upload.php'
                });
                uploader.init();

                var input = new mOxie.FileInput({
                  browse_button: 'browse',
                    multiple: false,
                    directory: true
                });

                input.init();
            </script>
        </body>
Comments