First time here? Check out the FAQ!
1

Avatar size limits: ASKBOT_MAX_UPLOAD_FILE_SIZE in settings.py

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.

parrah's avatar
51
parrah
asked 2016-02-01 18:35:33 -0600, updated 2016-02-01 18:40:10 -0600
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

2 Answers

1

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.

yoshida-mitsu's avatar
11
yoshida-mitsu
answered 2016-02-21 00:48:01 -0600
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments
0

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.

ViggieSmalls's avatar
1
ViggieSmalls
answered 2016-10-20 07:36:25 -0600
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments