Ask Your Question
1

Error uploading images into post

asked 2012-04-17 12:03:01 -0500

timewasted gravatar image timewasted
83 2 9

Forgive me for what is probably a simple question/solution, but I am unable to upload images into post. A javascript popup comes up and I choose the local file. Then I get a message "Error uploading file. Please contact the system administrator."

I have no idea what to look at to address this. I turned on debug mode and there are no errors. I looked in my apache logs and see no errors. My settings has this for images. I created the directory and chmod'ed it to 775.

#UPLOAD SETTINGS
FILE_UPLOAD_TEMP_DIR = os.path.join(
                                os.path.dirname(__file__),
                                'tmp'
                            ).replace('\\','/')

FILE_UPLOAD_HANDLERS = (
    'django.core.files.uploadhandler.MemoryFileUploadHandler',
    'django.core.files.uploadhandler.TemporaryFileUploadHandler',
)
ASKBOT_ALLOWED_UPLOAD_FILE_TYPES = ('.jpg', '.jpeg', '.gif', '.bmp', '.png', '.tiff')
ASKBOT_MAX_UPLOAD_FILE_SIZE = 1024 * 1024 #result in bytes
DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'

FILE_UPLOAD_TEMP_DIR translates to:

>>> from django.conf import settings
>>> settings.FILE_UPLOAD_TEMP_DIR
'/home/lmeadm/Sites/askbot-site/../askbot-site/tmp'
>>>

And my directory with perms:

drwxrwxr-x 2 lmeadm lmeadm  4096 2012-04-17 11:10 tmp

I don't see any other file/upload related settings.

delete close flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2012-04-17 12:44:28 -0500

timewasted gravatar image timewasted
83 2 9

I should have waited 5 more minutes before posting. It was a perms issue. I didn't realize that askbot itself logs to the project_folder/log directory. It was using a folder I didn't expect for uploads. I corrected permissions on that and all is well.

link publish delete flag offensive edit
2

answered 2012-04-17 12:13:16 -0500

Fitoria gravatar image Fitoria flag of Nicaragua
841 4 19
http://fitoria.net/

It's probably a permission error, depending on your server you can follow this guide to set up the read and write permissions correctly.

If you still have problems with this please paste fragments of your server logs to have more clues about the issue.

link publish delete flag offensive edit

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Reliable Askbot Hosting

Create your Q&A site at askbot.com. Managed Askbot hosting at just $15/mo. Dedicated hosting, support contracts, consulting services.

create your Q&A site
30 days free trial

Question tools

Follow

subscribe to rss feed

Stats

Asked: 2012-04-17 12:03:01 -0500

Seen: 49 times

Last updated: Apr 17 '12