Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

Dead simple drop-in multi file upload field for django forms using HTML5's multiple attribute.

Project description

# Django Multiupload

[![Build Status](](

Dead simple drop-in multi file upload field for django forms using HTML5's ``multiple`` attribute.

## Installation

* Install the package using pip (or easy_install if you really have to)

$ pip install django-multiupload

* Or directly from this repository to get the development version (if you're feeling adventurous)

$ pip install -e git+

## Usage

Add the form field to your form and make sure to save the uploaded files in the form's ``save`` method.

For more detailed examples visit the [examples section](

from django import forms
from multiupload.fields import MultiFileField

class UploadForm(forms.Form):
attachments = MultiFileField(min_num=1, max_num=3, max_file_size=1024*1024*5)

# If you need to upload media files, you can use this:
attachments = MultiMediaField(
media_type='video' # 'audio', 'video' or 'image'

# For images (requires Pillow for validation):
attachments = MultiImageField(min_num=1, max_num=3, max_file_size=1024*1024*5)

The latter two options just add fancy attributes to HTML's `<input>`, restricting the scope to corresponding filetypes.

from django.db import models

class Attachment(models.Model):
file = models.FileField(upload_to='attachments')


from django.views.generic.edit import FormView
from .forms import UploadForm
from .models import Attachment

class UploadView(FormView):
template_name = 'form.html'
form_class = UploadForm
success_url = '/done/'

def form_valid(self, form):
for each in form.cleaned_data['attachments']:
return super(UploadView, self).form_valid(form)


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-multiupload, version 0.5.2
Filename, size File type Python version Upload date Hashes
Filename, size django_multiupload-0.5.2-py2-none-any.whl (7.4 kB) File type Wheel Python version 2.7 Upload date Hashes View
Filename, size django-multiupload-0.5.2.tar.gz (5.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page