Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 513297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:24:29+00:00 2026-05-13T07:24:29+00:00

The Django docs ( http://docs.djangoproject.com/en/dev/topics/testing/#django.test.client.Client.post ) say to do this: >>> c = Client()

  • 0

The Django docs (http://docs.djangoproject.com/en/dev/topics/testing/#django.test.client.Client.post) say to do this:

>>> c = Client()
>>> f = open('wishlist.doc')
>>> c.post('/customers/wishes/', {'name': 'fred', 'attachment': f})
>>> f.close()

But when I do that the field has the error message “The submitted file is empty.” That smells like a PIL issue but the form works fine on the actual site.

Reading the file and sending that instead of just a handle doesn’t work either and behaves the same as passing an empty string.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T07:24:29+00:00Added an answer on May 13, 2026 at 7:24 am

    OK I figured it out. I was using the same dummy image for multiple fields and Django doesn’t reset the pointer after validating the first field.

    Also the example in the docs doesn’t show that images need to be opened in binary mode as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 488k
  • Answers 488k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer So you just want to remove the rows from the… May 16, 2026 at 8:43 am
  • Editorial Team
    Editorial Team added an answer So you want to create a submenu like in the… May 16, 2026 at 8:43 am
  • Editorial Team
    Editorial Team added an answer The most simple way is if you create a named… May 16, 2026 at 8:43 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I'm trying to implement signals from Django ( http://docs.djangoproject.com/en/dev/topics/signals/ ), or its concept in
ala this page http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#field-types Basically, I have a bunch of model field objects, and
A quickie, and hopefully an easy one. I'm following the docs at http://docs.djangoproject.com/en/dev/topics/auth/ to
I'm currently looking at the the documentation for Django sites: http://docs.djangoproject.com/en/dev/ref/contrib/sites/#ref-contrib-sites which explains how
Using django comments framework http://docs.djangoproject.com/en/dev/ref/contrib/comments/ Not sure is there option, to make all comments
The documentation says: http://docs.djangoproject.com/en/dev/ref/settings/#time-zone Note that this is the time zone to which Django
I'm using the Django Redirect app ( http://docs.djangoproject.com/en/ dev/ref/contrib/redirects/) but I'd like to have
I've read the Django documentation here: http://docs.djangoproject.com/en/dev/ref/forms/validation/ I've also browsed a number of search
I'm running Django 1.2 beta and trying out the new feature: message framework. http://docs.djangoproject.com/en/dev/ref/contrib/messages/
Is there analogue of Django Messages Framework (or RoR flash messages) in Java? http://docs.djangoproject.com/en/dev/ref/contrib/messages/

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.