![]() ![]() You can view the CodeIgniter 4 version of this tutorial here. Modify file restriction for the Dropzone according to your requirement in the you can find more about here and also in the controller file. Whenever a file is dragged then it will send an AJAX request to action URL for file upload. With only you can add dropzone to your webpage. Resources/dropzone.js' type='text/javascript'> Resources/dropzone.css' type='text/css' rel='stylesheet'> Use Dropzone.options to allow only image files and set the max file size to 1 MB. When a page is run this will add a container for upload files by drag & drop. Just need to create a " class= "dropzone" id="fileupload">. Include dropzone.js and dropzone.css in section. ![]() Download Dropzone from here and create a resources directory at project root to store dropzone.js and dropzone.css files.$config = $_FILES Ĭreate a new user_view.php file in application/views/ directory. Here, set the upload preference – upload path, allowed type, max file size, and file name. fileUpload() – This method is called when a file is a drag and drop on the dropzone container to upload a file.$route = 'User' Ĭreate a new User.php file in application/controllers/ folder and also create a uploads folder at project root to store files. Open application/config/routes.php and edit default_controller value to User. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |