Andrey
Andrey

Reputation: 559

check image dimensions before upload django

I made ajax image upload. How can I get image dimensions before file is uploaded? Or how can I stop uploading.

I wrote custom upload handler and have strange situation. If I'am trying to stop uploading file in "new_file" procedure by raising StopUpload(True) error - it works, but if I'am trying in receive_data_chunk procedure - it does not (actually django stops processing file, but server is still receiving data from client). I use apache+mod_python.

Tnx.

Upvotes: 1

Views: 655

Answers (1)

Rob Osborne
Rob Osborne

Reputation: 4997

Rather than rolling your own, I would use something like django-jquery-file-upload

Upvotes: 1

Related Questions