File validation process

2010-03-12 Thread Vincent
I would like some help in figuring out how to handle file validation in my application. I have a series of processing that I'd like to happen at various stages. Some of this validation might have to happen outside of Django itself, like using JavaScript in the actual form as the files that are to b

Re: File validation process

2010-03-13 Thread hcarvalhoalves
You could avoid the Javascript check (file extensions are just a convention, rarely thrustable) and just check the uploaded file mimetype on form validation code. `import mimetypes` for more. There's no clean way to interrupt file upload, though. On Mar 12, 11:27 pm, Vincent wrote: > I would li

Re: File validation process

2010-03-15 Thread Vincent
Thanks for the reply hcarvalhoalves. I can see bypassing the file name extensions as you have mentioned, they don't guarantee the file type anyway. That said, I would like to be able to use some other means than mimetypes as I need to make sure that the files are of a specific type (e.g. not just