Skip to main content

A file content type for gov usecases

Project description

Overview

This is a file content for plone which provides some useful functions, such as:

  • Write downloader-name in history (ftw.journal)

  • Image preview

  • Resumable downloads

Note: The ability to upload new file versions via drag and drop was removed in version 2.3.0 to reduce support overhead (it only worked in Plone 4).

Compatibility

ftw.file is compatible with Plone 4.3.x and 5.1.x.

Use 1.x for Archetypes implementation of ftw.file and 2.x for Dexterity based implementation.

The ability to use ftw.file Files in TinyMCE is no longer supported for the Dexterity based implementation (2.x).

Enabling versioning in 2.x

To enable versioning for the ftw.file.File dexterity type, you should go to the Types control panel for this type and select either manual or automatic versioning. This is equivalent to the following GenericSetup configuration in repositorytool.xml:

<?xml version="1.0"?>
<repositorytool>
  <policymap purge="false">
    <type name="ftw.file.File">
      <policy name="at_edit_autoversion" />
      <policy name="version_on_revert" />
    </type>
  </policymap>
</repositorytool>

And, yes at_edit_autoversion IS the correct setting for dexterity types.

Migration from 1.x to 2.x

A migration step is provided for migrating from Archetypes to Dexterity implementations. If however, you have been using TinyMCE integration in 1.x then you will need replace ftw.file.File with Image (or another type as you see fit) in the setting “TinyMCE / resourcetypes / imageobjects”.

Install

  • Add ftw.file to your buildout configuration

[instance]
eggs =
    ftw.file
  • Run buildout

  • Install ftw.file in portal_setup

  • If you are using the Dexterity based implementation (2.x) then you will probably want to set global_allow for Plone’s standard File type to False through the ZMI or a GS profile.

Changelog

2.6.6 (2021-10-21)

  • Add ftw.file.File SearchableText index. [mathias.leimgruber]

2.6.5 (2021-09-22)

  • Reindex modified date on DnD upload. [mathias.leimgruber]

2.6.4 (2021-09-14)

  • Set modification date on Dnd upload manually. [mathias.leimgruber]

2.6.3 (2021-09-14)

  • Remove DnD upload mask (from acient jquerytools), it does no longer work. [mathias.leimgruber]

  • Trigger modified event after upload via DnD. [mathias.leimgruber]

2.6.2 (2021-07-20)

  • Check for invalid_mimeteypes key in registry before accessing it directly. [mathias.leimgruber]

2.6.1 (2021-07-20)

  • Fix setting document_date if created without form. [mathias.leimgruber]

2.6.0 (2021-04-28)

  • Support HEAD request for /plone/folder/file.pdf/@@download/file/file.pdf [mathias.leimgruber]

  • Support HEAD request for /plone/folder/file.pdf/”view | download” [mathias.leimgruber]

2.5.0 (2020-11-10)

  • Feature: Restrict mimetypes allowed to use with ftw.file.File. [mathias.leimgruber]

2.4.4 (2020-10-12)

  • Fix comma in filename generates corrupt content-disposition (correctly implement rfc6266) [Nachtalb]

2.4.3 (2020-10-08)

  • Fix scale generation of DX Images in TinyMCE [Nachtalb]

2.4.2 (2020-09-16)

  • Add missing documentDate indexer for dexterity file [Nachtalb] Reindexing has to be done manually if necessary for your installation.

2.4.1 (2020-09-09)

  • Fix saving file with whole windows file path as filename when uploading through Microsoft Edge [Nachtalb]

  • Fix JS load order issue [Nachtalb]

2.4.0 (2020-09-03)

  • Reimplement drag’n’drop feature for Plone 5 and 4 [Nachtalb]

2.3.2 (2020-07-01)

  • Add ignore_fields parameter to ATToDXMixin.install_ftw_file_dx_migration(). [djowett-ftw]

2.3.1 (2020-01-31)

  • Quote URL (including filename) also in file redirect view. [mathias.leimgruber]

  • Use z2 Server to be closer to the real world in tests. [mathias.leimgruber]

2.3.0 (2020-01-23)

  • Remove drag and drop upload to reduce support overhead (it only worked in Plone 4). [djowett-ftw]

2.2.6 (2020-01-21)

  • Override content_type method to fix mime_type metadata. [tinagerber]

2.2.5 (2020-01-09)

  • Add ftw.file portal_type translation to plone domain. [tinagerber]

2.2.4 (2019-12-18)

  • Remove JavaScript console statement (YAY) which accidentally added in the prior release. [jone]

  • Replace the upload utility with a separate package to prevent conflicts [Nachtalb]

2.2.3 (2019-12-16)

  • Plone 5: provide precompiled bundle. [jone]

  • Fix deleting Plone site. [jone]

2.2.2 (2019-11-26)

  • Fix upgrade steps that wouldn’t run in 2.x codebase. [djowett-ftw]

2.2.1 (2019-11-25)

  • Fix ConfigurationConflictError occurring when plone.app.widgets added in Plone 4. [djowett-ftw]

  • Pin plone.protect to minimum version supplying IDisableCSRFProtection [djowett-ftw]

2.2.0 (2019-11-14)

  • Add a FileUpload adaptor for plone.namedfile so that ftw.file uploads can work in ftw.simplelayout’s FileListingBlock. [djowett-ftw]

  • Fix contentType attribute type. It needs to be utf-8 for the zope.schema.BytesLine. [mathias.leimgruber]

  • Remove ftw.calendarwidget dependency [Nachtalb]

2.1.0 (2019-11-12)

  • Add support for Plone 5.1. [buchi]

2.0.3 (2019-11-05)

  • DX migration: ignore flowplayer fields (width and height). [jone]

2.0.2 (2019-11-05)

  • Fix ftw.theming integration [mathias.leimgruber]

  • Fix incorrect ID in FTI definition. [jone]

  • Dexterity migration: import GS profile even when not migrating content. [jone]

2.0.1 (2019-11-04)

  • Add “getContentType” method to ftw.file.File to support legazy code. [mathias.leimgruber]

  • Fix ftw.file.File FTI - wrong factory. [mathias.leimgruber]

  • Add ftw.theming integration (Icon). [mathias.leimgruber]

2.0.0 (2019-10-30)

  • Move to Dexterity, remove Archetypes functionality (but not models) [mathias.leimgruber, djowett-ftw]

  • Add AT to DX migration step [mathias.leimgruber, djowett-ftw]

  • Remove TinyMCE integration [djowett-ftw]

  • Rename model fields while migrating to dexterity [djowett-ftw]

  • Stop drag and drop upload adding two versions [jone, djowett-ftw]

  • Add uninstall profile [djowett-ftw]

1.16.2 (2019-05-14)

  • Improve umlaut support for MSIE file download [busykoala]

1.16.1 (2019-04-02)

  • Add umlaut support for MSIE file download [busykoala]

1.16.0 (2018-10-16)

  • Protect the edit form tab (schemata) for the expiration date and effective date with a separate permission. [mbaechtold]

1.15.0 (2018-03-14)

  • Drop support for Plone 4.2. [mbaechtold]

  • Prevent exception upon HEAD requests to the download view of a file. [mbaechtold]

1.14.0 (2017-11-16)

  • A new registry record can be used to prevent redirects to the download view of the file. [mbaechtold]

  • Rewrite download redirection tests using ftw.testbrowser, drop dependency on ftw.testing[splinter]. [lgraf]

1.13.0 (2017-05-15)

  • Added option to download file with inline content-disposition header. [lknoepfel]

  • A new option on the file can be used to protect a file. Protected files cannot be deleted by anyone until the option is unchecked. [mbaechtold]

1.12.0 (2016-11-24)

  • Record ftw.activity event when file downloaded. [jone]

  • Eliminate bad security declarations through interface. [jone]

  • Simplify schema inheritance. [jone]

  • Fix security declarations for getOriginFilename, is_image and getField. [jone]

1.11.5 (2016-07-19)

  • documentDate is now required. https://github.com/4teamwork/ftw.file/issues/64 [elioschmutz]

  • Set batch size to 10. 50 is imho way to mutch, event 20 makes me scrolling 3 down. So 10 is imho OK. No? let’s fight… or someone implements a configurable number. [mathias.leimgruber]

  • Added pagination for journal. [lknoepfel]

  • Allow SiteAdministrator to add files. [tschanzt]

1.11.4 (2016-01-27)

  • The origin filename must not contain “/”. Otherwise a 404 will occur when the user tries to download the file. [mbaechtold]

  • Reload page if drag&drop upload has failed. [elioschmutz]

1.11.3 (2016-01-05)

  • Fix journal action translation for files [elioschmutz]

  • Fix drag’n’drop for files in Firefox. [Kevin Bieri]

  • Fix regression when trying to link files in TinyMCE. The problem was that only images were linkable. [jone]

  • Fix tests for new colorbox version. [tschanzt]

1.11.2 (2015-09-10)

  • Details view: refactor template binding for easeier subclassing. By moving the template binding to python code, subclasses can still render the default template conditionally. [jone]

1.11.1 (2015-09-09)

  • Fix jsondetails function, so it doesn’t crash when not finding scales. [tschanzt]

1.11.0 (2015-09-08)

  • Remove icon effect when replacing file. [jone]

  • Add adjustments to integrate bumblebee
    • Trigger event dndUploadViewUpdated if drag&drop is finished

    • Trigger ObjectEditedEvent from Products.Archetypes instead zope. lifecycleevent after quickupload

    • Register a resource-directory: ftw.file.resources

    • Create a FileMetadata utility

    [elioschmutz]

  • Fix Outputfilter, so it does work with scaled images. [tschanzt]

  • Integrate ftw.file images with TinyMCE. [lknoepfel]

  • Only load ftw.activity 1.x representation if ftw.activity 1.x is installed. [mathias.leimgruber]

  • Show a hint about the imminent file replacement in the dropzone overlay. [mbaechtold]

  • Make sure object modified is fired on quickupload. [lknoepfel]

  • Check for file type before dragging [Kevin Bieri]

1.10.0 (2014-12-16)

  • The file can be replaced with drag’n’drop (modern browsers only). [mbaechtold]

1.9.0 (2014-09-15)

  • ftw.activity integration: display preview image in activity stream. [jone]

  • Use ftw.profilehook instead of custom import steps (setuphandlers). [jone]

1.8.2 (2014-08-07)

  • When replacing the file, use the new filename given by the file. [lknoepfel]

  • Catch OverflowError for unkown PSD formats. [jone]

  • Don’t journalize when our user has no id. [tschanzt]

1.8.1 (2014-02-10)

  • Improve file download implementation by using a stream iterator and supporting range and if-modified-since requests. [buchi]

  • Make download view use our file download implementation. [buchi]

1.8 (2013-12-23)

  • Add editable filename functionality. The File-Schema is extended with a new StringField: originFilename. You can set a new filename without touching its extension. [elioschmutz]

  • Use ftw.colorbox for ftw.file overlay. [tschanzt]

  • Use PIL itself to detect images. [tschanzt]

  • Remove percent signs from download URL to fix problems in combination with Apache mod_rewrite. [buchi]

1.7.4 (2013-11-28)

  • Require ftw.upgrade >= 1.4.0 required by upgrade 1514. [jone]

  • Add upgradestep to recalculate wrong contenttypes. [tschanzt]

1.7.3 (2013-11-04)

  • Customize getIcon method. Search MimetypeRegistry before using iconmaps. [tschanzt]

1.7.2 (2013-10-16)

  • Add French translations. [tschanzt]

1.7.1 (2013-07-19)

  • Fix regression in download redirect with unicode filenames. [jone]

1.7.0 (2013-07-18)

  • Drop Plone 4.1 support. [jone]

  • File download: redirect to URL containing filename. This allows us to easily track downloads in statistics tools. [jone]

  • Redirect users without any modifying permissions (without editable border) to the download when not hitting a specific view. Also add File back to allowAnonymousViewAbout for making sure that /view is added in the navigation. [jone]

1.6.4 (2013-06-04)

  • Fix Upgradestep. [tschanzt]

1.6.3 (2013-05-31)

  • Add additional Schemata for removal since it was renamed. [tschanzt]

  • Add permission to edit advanced fields. [tschanzt]

1.6.2 (2013-05-17)

  • Hide author in file view if anonymous and allowAnonymousViewAbout is False. [Julian Infanger]

1.6.1 (2013-04-17)

  • Lawgiver support: map permissions. [jone]

1.6 (2013-01-21)

  • Drop Plone 4.0 support. [jone]

  • Hide view action for file. [Julian Infanger]

1.5 (2012-10-16)

  • Add missing dependency in setup.py [tschanzt]

  • use new document_date instead of effectiveDate. [tschanzt]

1.4.12 (2012-05-09)

  • Show time too on contenthostory viewlet. [mathias.leimgruber]

1.4.11 (2012-05-01)

  • Readded i18n:translate for content history viewlet action. [mathias.leimgruber]

1.4.10 (2012-04-30)

  • Fixed filename in response header for download. [Julian Infanger]

1.4.9 (2012-03-12)

  • Table head should be in thead, body in tbody. [Julian Infanger]

1.4.8 (2012-03-05)

  • Added plone default classes to tables. [Julian Infanger]

1.4.7 (2011-12-21)

  • The image preview, should no be squarish. [mathias.leimgruber]

1.4.6 (2011-12-21)

  • Fixed MANIFEST.in (include *.rst) [mathias.leimgruber]

1.4.5 (2011-12-21)

  • add test for is_image method in FileView [eschmutz]

  • fix: error when uploading a not scalable image mimetype (i.e. .dwg) we now check for allowed mimetypes to fix the error [eschmutz]

1.4.4 (2011-08-22)

1.4.3 (unreleased)

  • created imagepreview in file_view [ttschanz]

  • Added registry.xml for user_ids field. [mathias.leimgruber]

  • Added setFilename() method. [Thomas Buchberger]

1.4.2

  • First move effectiveDate field to default schemata, then change write permissions on all other fields (except default schemata) [31.05.2011, mathias.leimgruber]

1.4.1

  • Do not show specific users in Journal [16.02.2011, ttschanz]

1.4

  • Show Journal to members with Reader-role. [mathias.leimgruber]

1.3

  • Link to author’s site [mathias.leimgruber]

  • Removed styles, this should be done by theme [mathias.leimgruber]

  • Some translations / Added default_method to effectiveDate. [mathias.leimgruber]

1.2

1.1

1.0

  • Initial release

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

ftw.file-2.6.6.tar.gz (166.2 kB view details)

Uploaded Source

File details

Details for the file ftw.file-2.6.6.tar.gz.

File metadata

  • Download URL: ftw.file-2.6.6.tar.gz
  • Upload date:
  • Size: 166.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for ftw.file-2.6.6.tar.gz
Algorithm Hash digest
SHA256 8da9734e57d6e6185cd30917b34d3c1751f90f378f23c3dc3901bd881b40c9c6
MD5 b384591e9f230043a72ea078217f3470
BLAKE2b-256 c2114002b84f5c06164b868230e60a67deffdc15f5680123766b65743887e0c8

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