// UPLOAD CONTROLLER (example code below, this is used for uploading files sent from jquery-file-upload iframe module)

./modules/users/controller/UploadController.php

Script Examples

This is a simple upload controller for use with BlueImp/JQuery-File-Upload. The idea is that you create a module, then you put the controller in it. So for instance if you have a module called "User" you create a controller called "UploadController.php". Then you put the url for the upload controller in the form which you will use as your view script (the default form with jquery-file-upload).

MEAT AND POTATOES:

The bulk of this code is primarily the Upload Controller. This will replace the "upload.php" file, and it's used primarily because ZendFramework doesn't play nice with the standard "upload.php" code as you might have noticed. It's better to completely integrate with the framework, so this provides a super simple way to do that. It can certainly be refined.

Standard Blueimp/Jquery-File-Upload form template:

This is just the standard template for myform.phtml. The template above is mainly split up for educational purposes to show you what you need to change. The code below is in the jquery-file-upload example. It's included just so you know what goes in the myform.phtml.

Conclusion

This script is very simple. It shows a nifty way to replicate the behavior utilized in the default upload.php code, the only difference being that it's done in Zend Framework and with 100 lines of code. If you need to add stuff to a database I highly recommend using Doctrine for that!