use StringIO and getvalue instead of os.save to save the db's filefield