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 8935029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:54:10+00:00 2026-06-15T09:54:10+00:00

When I submit to Django a multiple files upload form <input type=file name=files multiple

  • 0

When I submit to Django a multiple files upload form

<input type="file" name="files" multiple />

I get a sensible result in request.FILES:

(MultiValueDict: {u'files': [(InMemoryUploadedFile: 0202.jpg (image/jpeg)), (InMemoryUploadedFile: 0203.jpg (image/jpeg))]})

But then my confusion starts. I thought request.FILES['files'] would contain a couple of files (appears to be a list), but it shows only

0203.jpg

No InMemoryUploadedFile part and more importantly: only the last file!

Looping through request.FILES with .iteritems() only goes over that one file too, request.FILES['files'] is distinctly uniterable; the below code actually froze up the console and made it beep endlessly:

for v in request.FILES['files']:
    print v
    print type(v)

So… Is any of this this normal? What am I doing wrong?

As I’m starting to think this may be a bug: I’m using Django 1.4.2 with Python 2.7 on Windows 7.

  • 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-06-15T09:54:10+00:00Added an answer on June 15, 2026 at 9:54 am

    It turns out the answer was on Stack Overflow after all, on a slightly different (client side, at least) problem here: multiple files upload using same input name in django

    Turns out that request.FILES['files'] was wrong and should have been request.FILES.getlist('file').

    Why this is the case is a complete mystery to me. If anyone can answer with an explanation, I’ll gladly switch the accepted answer.

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

Sidebar

Related Questions

Django accepts and works with form button in format: <input type=submit value=Submit /> How
about click and submit example below: <form action=url method=post> <input type=text id=input1/> <input type=submit
I have a pretty simple file upload form class in django: class UploadFileForm(forms.Form): category
I'm new to Django and just trying to submit a form using ModelForms to
Please submit only one zip file .Your zip file should contain the following files:
I have a django form with two different submit buttons, on the view where
How do I submit a javascript object via jQuery to django? $.ajax({ type: 'POST',
I have script which shows me image in django form before I click submit.
I have a search form in Django. When the user click in the submit
Django when i send the following string from an ajax submit i get the

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.