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.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
parrah's avatar
51
parrah
asked 9 years ago, updated 9 years ago

Comments

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.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
yoshida-mitsu's avatar
11
yoshida-mitsu
answered 9 years ago
link

Comments

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.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
ViggieSmalls's avatar
1
ViggieSmalls
answered 8 years ago
link

Comments

see more comments