Re: Sending File Upload Handler errors to the view

2009-08-05 Thread Kai
I've found a reason for why I couldn't get it working and a solution as well. It would appear that Django uses lazy evaluation for request.FILES to determine when the upload handler is called. Therefore, the upload handler is only evoked when and if you attempt to access request.FILES. Additional

Sending File Upload Handler errors to the view

2009-08-05 Thread Kai
Hi all, I want to stop any file uploads that don't end in my designated extension as soon as they're received. To do this, I define a custom Upload Handler and write new_file to look something like this: def new_file(self, field_name, file_name, content_type, content_length, charset=None):