In this post, I will show you, how to upload files with drag and drop interface with dropzone.js in your Codeigniter framework applications.
Based on the plugin documentation Dropzone.js works in :
- Chrome 7+
- Firefox 4+
- IE 10+
- Opera 12+ (Currently disabled for MacOS because their API is buggy)
- Safari 5+
For all the other browsers, dropzone provides an old-school file input fallback.
How to implement in Codeigniter
1.First Download CodeIgniter, and setup locally. Then create a folder in application root folder(where index.php lives) for storing uploaded Files.
2. Download dropzone.js from https://github.com/enyo/dropzone, extract the zip copy all files from download folder, and place it in your resources folder(create folder just like uploads).
3. create a controller File called dropzone.php in controller dir then place the fallowing code.
4 Create a view File Called dropzone_view.php in views.Feed with bellow code
I hope this tutorial helps you please don’t forget to give us your feedback in comments.
I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.
I am Arjun from Hyderabad (India). I have been working as a software engineer from the last 7+ years, and it is my passion to learn new things and implement them as a practice. Aside from work, I like gardening and spending time with pets.