Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

File upload functionality

Project Description

Add basic file upload functionality to your Pyramid app.

Use

Prepare environment.

export VIRTUAL_ENV=~/.virtualenvs/crosscompute
virtualenv ${VIRTUAL_ENV}
source ${VIRTUAL_ENV}/bin/activate

export NODE_PATH=${VIRTUAL_ENV}/lib/node_modules
npm install -g browserify uglify-js

Install package.

cd ~/Projects/invisibleroads-uploads
python setup.py develop
bash refresh.sh

Add settings.

upload.id.length = 32

Configure views.

config.include('invisibleroads_uploads')

Call template macro.

{% from 'invisibleroads_uploads:templates/parts.jinja2' import upload_button %}
{{ upload_button(request, id='xyz-upload', text='Browse for xyz', class='xyz') }}

Add callback and activate button.

$('#xyz-upload').on('uploaded.ir', function(e, d) {
  console.log(d.upload_id);
}).enable();

0.4

  • Define Upload.save, Upload.save_from, Upload.load
  • Replace get_upload_from with Upload.get_from

0.3

  • Handle HTTP status code 413 Payload Too Large

0.2

  • Ignore multiple clicks on upload button until dialog closes
  • Replace uploaded.ir.upload with uploaded.ir

0.1

  • Add basic upload functionality
  • Ignore multiple clicks on upload button for a few seconds

Release History

This version
History Node

0.4.2.2

History Node

0.4.2.1

History Node

0.4.1

History Node

0.4.0

History Node

0.3.1

History Node

0.3.0

History Node

0.2.3

History Node

0.2.2

History Node

0.2.1

History Node

0.1.1

History Node

0.0.5

History Node

0.0.4

History Node

0.0.3

Download Files

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

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
invisibleroads-uploads-0.4.2.2.tar.gz
(14.5 kB) Copy SHA256 Hash SHA256
Source None Feb 17, 2018

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers DreamHost DreamHost Log Hosting