Mike Axiak wrote: > 1. Leave forms code alone, causing (a) DeprecationWarnings and (b) > the files to be read into memory when saving. > 2. Modify the form code to access the attributes of the > UploadedFile, but on AttributeError use the old dict-style interface > and emit a DeprecationWarning. > 3. Modify form code to use the new UploadedFile object, but just > break on the old dictionary access as it's largely an internal API > anyway.
I don't like #1 because there's no point to keep deprecated code in Django where we can fix it. And #3 is indeed broken because there is much code in the wild that uses request.FILES directly. It's a public API after all. #2 looks reasonable to me. > I realized that I just want people to have a list interface. > Therefore, I decided to just leave it as a plain old list. Thus, to > add an upload handler, you'd just write:: > > request.upload_handlers.append(some_upload_handler) > > And to replace them all:: > > request.upload_handlers = [some_upload_handler] > > I've made a few efforts to ensure that it will raise an error if the > upload has already been handled. I know this isn't as simple as the > .set_upload_handler() interface, but I think it's the simplest way we > can support the list modification/replacement in a useful fashion. > What do people think about this? It would be good to invent a declarative setting for this but since it's a per-view thing it would be hard. So may be indeed a list would be enough. > Currently when you try uploading Large files > (~2GB and greater), you will get a weird Content-Length header (less > than zero, overflowing). > ... > Should > I/we just ignore this and expect people to be sane and upload > reasonable data? If Content-Length header is crewed then neither we, nor users can do anything about it. When these file volumes become more widespread I believe browsers will fix themselves to send correct Content-Length. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---
