Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.


ztfy.file is unavailable in PyPM, because there aren't any builds for it in the package repositories. Click the linked icons to find out why.

 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
Windows (64-bit)
Mac OS X (10.5+)
Linux (32-bit)
Linux (64-bit)

What is ztfy.file ?

ztfy.file is a set of classes to be used with Zope3 application server. The purpose of this package is to handle :

System Message: ERROR/3 (<string>, line 12)

Unexpected indentation.
  • custom schema fields with their associated properties and browser widgets to automatically handle fields as external files
  • automatically handle generation of images thumbnails for any image ; these thumbnails are accessed via a custom namespace ("++display++w128.jpeg" for example to get a thumbnail of 128 pixels width) and are stored via images annotations
  • allow selection of a square part of a thumbnail to be used as a "mini-square thumbnail".

Square thumbnails selection is based on JQuery package extensions, so the ztfy.jqueryui is required to use all functions of ztfy.file package.

How to use ztfy.file ?

A set of ztfy.file usages are given as doctests in ztfy/file/doctests/README.txt


  • added annotations check
  • added IWatermarker interface and utility
  • corrected TAR extractor to correctly handle directories
  • corrected GZip extractor to correctly implement IArchiveExtractor interface
  • added MIME types vocabulary (based on file extensions)
  • added libmagic MIME types vocabulary
  • commit transaction before sending blob file and change opening mode to 'c'
  • updated locales
  • updated style of files download links
  • use ZTFY.skin data API
  • allow FileProperty value update from a FileUpload input
  • syntax correction in HTML field input
  • added display template for HTML input field
  • force images in "RGBA" mode when reading images in "P" mode before resizing while generating thumbnails
  • added new getMagicContentType function
  • added archives extraction interface and utilities
  • added "downloadable" attribute on file/image widgets
  • corrected display widgets
  • switch dependencies from PIL to Pillow
  • changed package source layout
  • include IObjectCopiedEvent subscriber moved from ztfy.extfile package
  • remove default JPEG format when creating thumbnails (thumbnails are now created by default using the same file format as the original image); JPEG is only used as default when source image is not in JPEG, PNG or GIF format
  • use PIL to get image size when not in JPEG, PNG or GIF format
  • added 'display:' TALES adapter to easily get display adapter from page templates
  • update imports for last ztfy.jqueryui and ztfy.skin packages
  • automatically add filename extension in name of FileField or ImageField attributes values. WARNING: since then, getting field data directly from request returns a tuple made of file content and file name !!
  • use mimetypes package to get content-type for text files
  • updated doctests
  • modified ++file++ and ++display++ namespaces to accept an extension
  • added ImageFieldDataConverter to check that uploaded files are really images
  • changed position of file input fields
  • changed handling of jQuery's "imgAreaSelect" plug-in
  • added check in image field widget thumbnail generation code
  • added extension in displays URLs
  • changed square thumbnails management by using JQuery "imgAreaSelect" plug-in
  • handle NOT_CHANGED value in square thumbnails converters
  • handle z3c.form NOT_CHANGED value in file field data converter
  • migrated resources management from zc.resourcelibrary to Fanstatic
  • Switched to ZTK-1.1.2
  • added a little sharpening on thumbnails generation
  • added conversions while getting position and dimension of square thumbnails generation
  • initial release

Subscribe to package updates

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.