I am using the Jquery file upload plugin, in particular this one:
http://bundles.laravel.com/bundle/jUpload
I wish to be able to set the upload_dir differently for different web pages.
Is this possible? If so, how can I set upload_dir based on different web page requirements?
It is currently set in settings.php though these values are shared across the plugin (which am sure is the purpose).
upload_dir = '/users/folder1/files.txt'; //web page 1
upload_dir = '/users/folder2/files.txt'; //web page 2
any ideas on making the above possible?
I have managed to resolve this issue as follows:
1) created a separate main.js file for each web page, e.g. main.js, main.js
2) created a separate settings file (though this is not strictly required)
3) at runtime in my route after getting values from the settings file, I add the page specific ‘upload_dir’ to the $options array, just before instantiating the UploadHandler.
and that’s it 🙂