Ask Your Question
1

Avatar size limits: ASKBOT_MAX_UPLOAD_FILE_SIZE in settings.py

asked 2016-02-01 18:35:33 -0600

parrah gravatar image

updated 2016-02-01 18:40:10 -0600

In my settings.py, I changed ASKBOT_MAX_UPLOAD_FILE_SIZE to 10MB, as below.

ASKBOT_ALLOWED_UPLOAD_FILE_TYPES = ('.jpg', '.jpeg', '.gif', '.bmp', '.png', '.tiff')

ASKBOT_MAX_UPLOAD_FILE_SIZE = 10 * 1024 * 1024

DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'

I restart server again, and I still get the file size error displayed in yellow color ("Your file is too big (1.1 MB), the maximum allowed size is 1.0 MB").

Do you have any suggestions? I don't know if it's related, but I use Amazon EC2 and RDS.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2016-02-21 00:48:01 -0600

yoshida-mitsu gravatar image

Hi, the same thing has occurred in our environment as well. Has anyone resolved this issue? We'd like to allow pdf and MSWord/Excel etc. documents attached, however 1MB limitation is too small.

Thanks in advance.

edit flag offensive delete link more
0

answered 2016-10-20 07:36:25 -0600

You can change the file size as described is 'settings.py'.

ASKBOT_MAX_UPLOAD_FILE_SIZE = 10 * 1024 * 1024

When you want to upload and it doesn't work, then look at the messages askbot sends (I have them stored in a file under /tmp/askbot-messages).

EMAIL_BACKEND = 'django.core.mail.backends.filebased.EmailBackend'
EMAIL_FILE_PATH = '/tmp/askbot-messages' # change this to a proper location

They show you what the error is. Mine was that there was no tmp directory in my askbot directory.

  File "/usr/lib/python2.7/tempfile.py", line 239, in _mkstemp_inner
    fd = _os.open(file, flags, 0600)
OSError: [Errno 2] No such file or directory: '/srv/askbot2/viki/tmp/tmpYMJteQ.upload'

So I made a directory tmp with 777 permissions. This works for me. Now I can upload PDFs with size over 1 MB.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2016-02-01 18:35:33 -0600

Seen: 441 times

Last updated: Feb 01 '16