Source: https://code.tutsplus.com/tutorials/how-to-program-with-yii2-uploading-files–cms-23511
There are two file upload plugins for Yii2 that seem the most robust:
- The FileInput Widget by Kartik Visweswaran (shown above)
- The 2Amigos BlueImp File Uploader (a wrapper for the BlueImp JQuery File Uploader)
For this tutorial, I decided to continue with Kartik's plugin. I found it easier to use and better documented than the 2Amigos plugin. However, the BlueImp File Uploader has some intriguing user experience features that you may want to explore (shown below):
Working With the FileInput Plugin
Let's begin to install and make use of the file uploader and integrate it into our Twitter-like status creation applet. Again, we'll use the Yii2 Hello application tree which you can download with the GitHub button link beside or below.
Installing the Plugin
First, we can use composer to add kartik-v/yii2-widget-fileinput
to our application:
There are two file upload plugins for Yii2 that seem the most robust:
- The FileInput Widget by Kartik Visweswaran (shown above)
- The 2Amigos BlueImp File Uploader (a wrapper for the BlueImp JQuery File Uploader)
For this tutorial, I decided to continue with Kartik's plugin. I found it easier to use and better documented than the 2Amigos plugin. However, the BlueImp File Uploader has some intriguing user experience features that you may want to explore (shown below):
Working With the FileInput Plugin
Let's begin to install and make use of the file uploader and integrate it into our Twitter-like status creation applet. Again, we'll use the Yii2 Hello application tree which you can download with the GitHub button link beside or below.
Installing the Plugin
First, we can use composer to add kartik-v/yii2-widget-fileinput
to our application:
0 Comments