Forums

Uploading Images Through Forms

I'm having some issues uploading an image through a user form on my Django app. This works fine locally through a user form and works through admin ok on PA but doesn't when using a user form within the app on PA. Has anyone had any experience of this? The upload_to directory is a subdirectory of my media folder which does have the url mapped. I can't see any errors in my logs either. Is there something else that's needed to be included? Looks like the images are not being stored as are also not retrievable.

Have you checked that the images are actually being saved by looking at your filesystem? Also, if you're not getting an error, it is possible that you have not included the code necessary to save the file to disk?

Thanks Glenn. Found the issue was that I'd enctype="multipart/form-data" on the post creation form but not on the form for the user to edit post.