#9184 closed (invalid)
'str' object has no attribute 'chunks'
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Core (Other) | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Uploading file to FileField causes AttributeError. I used
my_object.my_field.save(somename, content, save=False)
Here content is a string from
request.FILES['filedata'].read()
Attachments (2)
Change History (4)
by , 16 years ago
Attachment: | storage_save_str_fix.diff added |
---|
follow-up: 2 comment:1 by , 16 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
According to the documentation: http://docs.djangoproject.com/en/dev/ref/files/file/#django.core.files.File.save
The content argument is supposed to be a subclass of File, such as UploadFile. Just use request.FILESfiledata for content instead of request.FILESfiledata.read()
Note:
See TracTickets
for help on using tickets.
patch - attrib check on content