Skip to main content

File and Image upload fields for forms.

Project description

Right now this package provides 2 widgets, FileField and ImageField. These widgets support file uploading with server side caching. That means that if some other field in the form fails validation, the user wont have to upload the file again. Instead they get the information of the file they included or a thumbnail of the image if it’s an ImageField. An option to remove the file from the form is given too.

The ImageField has a thumbnail preview and allows size validation and automatic resizing when dimensions get past certain values (this isn’t enabled by default).

If Lightbox is installed (optional), the full size images will be displayed with it (non popup image viewer). Also an animation removing the file attached to the form will be shown if Scriptculous is installed (optional). The server side caching is done using the TemporaryFile class from the official Python tempfile module. It’s a secure way to store files on a platform independent way. The files are cleared when they are not used anymore.

The widgets need a controller that will be the file server for the download links and images previews. You can import the controllers from file_fields.controllers (PicServer and FileServer) and specify the url on the widget constructors (file_server_url, image_server_url)

The easiest and recommended way is enabling the extension your dev.cfg, prod.cfg or app.cfg adding:

file_field_server.on = True

Project details


Download files

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

Source Distribution

FileFields-0.1a6.dev-r612.zip (16.2 kB view details)

Uploaded Source

Built Distribution

FileFields-0.1a6.dev_r612-py2.4.egg (24.7 kB view details)

Uploaded Source

File details

Details for the file FileFields-0.1a6.dev-r612.zip.

File metadata

File hashes

Hashes for FileFields-0.1a6.dev-r612.zip
Algorithm Hash digest
SHA256 2a2a5ff20fac67be7d8d85e7a56fabc448bb4f841e5ae1f2b1d14e453f249560
MD5 ae2ef362e81c83a746dcd8cbff95d60e
BLAKE2b-256 7c77d268f8729ccda2c1f8d69d1db52191d8270eae3ea3864c058b87d7298177

See more details on using hashes here.

File details

Details for the file FileFields-0.1a6.dev_r612-py2.4.egg.

File metadata

File hashes

Hashes for FileFields-0.1a6.dev_r612-py2.4.egg
Algorithm Hash digest
SHA256 8d96e144c1e00286d1b4c5312607e0da4576a57b0ce1c9427516d6e2af7b6994
MD5 9b607fb033e8d25a583870a5abe131fb
BLAKE2b-256 94a11257a619d76ee34f9d0f3490e0a3b6bd893fb7d760aa6ed6631a8a43e29f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page