As multimedia becomes more and more prevalent these days, an interactive file uploader becomes extraordinarily useful. I ran into such a situation recently when developing a Django web application of my own. In this case I chose to use Uploadify because I’ve used it in the past, it integrates well with jQuery, and in my experience has been not only the easiest to work with but the least problematic.
Working with flash-based file upload systems is relatively easy with Django assuming that they send a standard POST request to the server and you understand the way Django chooses to handle file uploads. Django provides file upload handlers which may be modified to perform more sophisticated tasks during file uploads if you wish, but in this case we will stick with the built in upload handlers. When you upload a file to a Django view it takes the name of the upload field in your template and puts that name into the request.FILES dictionary where the value of that entry is an UploadedFile object or a subclass thereof. This UploadedFile object contains basic information about the file being uploaded including its file name as it was uploaded and its complete size. In addition, it gives you file-like access methods to the uploaded data which allow you, the programmer, to decide how the data gets stored.
Filed under:Tags: django, file uploads, flash uploader, integration, Python, uploadify, web development


