Uploading files corrupted on windows bug and suggested fix
Hi all,
Okay, I think I have found the source of this problem.
In djangobb_forum/forms.py about line 112 there is the line
file(path, 'w').write(memfile.read())
which I changed to
file(path, 'wb').write(memfile.read())
and then also in djangobb_forum/views.py about line 789
file_data = file(attachment.get_absolute_path()).read()
I changed to
file_data = file(attachment.get_absolute_path(), 'rb').read()
These file modes is what was corrupting the attachment upload and download on windows. Changing the files to be accessed in binary mode in windows seems to have fixed the problem.
Regards
Kiwi_NZ