Upload folder

Set remote upload folder

Code

                        <!DOCTYPE html>
    <html>
    <head>
        <title>Set remote upload folder</title>
        <link rel="stylesheet" type="text/css" href="css/minimal.css" />
        <script src="js/RealUploader.js"></script>
    </head>
    <body><div id="targetElement"></div>
    <script type="text/javascript">
        var uploader = new RealUploader("#targetElement", {
            remotePath: "upload_here/" //this can be a function that returns a path/string
        });
    </script>
    </body>
    </html>
                    

It is recommended for security reasons to set or calculate the uploader on the server side. One possible approach could be the following:

  • Extend the RealUploader class inside Uploader.php
  • Override the setUploadPath method

Result