WebFaction
Community site: login faq

Hello everybody!

I'm currently new in WebFaction services, just deploying my first Django Application. Everything worked fine until I've tested a file upload form.

The structure I've built is: a static application for serving static files, a static application for serving media files (for e.g app_media, located in ~/webapps/app_media)

In myproject.settings.py, the MEDIA_ROOT is /home/<user>/webapps/app_media/.

However, when I try to upload a file (in admin or in every site form), I get the error: Upload a valid image. The file you uploaded was either not an image or a corrupted image.

I've checked and the Python Imaging Library (PIL) looks installed. I can import it in shell.

Can somebody give me a little help? Thanks a lot.

asked 29 Feb '12, 06:23

trd002200
112
accept rate: 0%


This does seem related to PIL, however it's hard to say what the problem is without looking at the actual Django app. I'd suggest that you open a ticket about it.

permanent link

answered 29 Feb '12, 07:26

todork
1.2k5
accept rate: 34%

I thought this too but... the problem was that I made a terrible mistake. The MEDIA_ROOT should remain the absolute path to the folder where the files will be uploaded, not to the media serving application. Everything works just fine.

permanent link

answered 29 Feb '12, 07:49

trd002200
112
accept rate: 0%

edited 29 Feb '12, 07:50

Glad to see you've worked it out.

(29 Feb '12, 07:50) todork
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×909
×108
×29
×22
×5

question asked: 29 Feb '12, 06:23

question was seen: 6,280 times

last updated: 29 Feb '12, 07:50

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2020 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM