Skip to content

New attachment features

daviddurand edited this page Nov 16, 2012 · 1 revision

There are some new features in the attachments area: We haven't yet written up the documentation, but they are pretty much as you might expect:

  • The Display Name field is an alternative to the file name will be used as the anchor text in attachment links instead of the file name. (Note that automatically generated HTML links to attachments only exist in the new reading interface). Attachments are still linkable from PDFs as they always were.

  • The is Visible setting controls an attachments presence in that list. If the box is unchecked, the attachment will still be available at its normal URL, but it won't be linked from the list. When placing web content in the attachments to a document, that that's useful for things like the stylesheets, etc.

  • The is download checkbox cotrols whether the link will be delivered directly to the browser without requesting that it be saved as a file. This parameter adjusts the Content-Disposition header of the HTTP result for the attachment. If the link is checked (the default) it will be treated as a downloadable file. In both cases the Content-Disposition header will suggest the filename as the name to be used if the file is saved or downloaded.

  • Filenames of files can now contain the / character, which means that chunks of interrelated web content can be uploaded to one attachment area. These / characters are not %-escaped, and are treated as path components for relative URLs if their content contains HTML.

  • The relative URL value shows a value that will link to the attachment if placed on any of the pages of the document, including the TOC. (Note that the canonical TOC url has a trailing slash as generated by Tizra. The attachment link suggested here will not work from a handcrafted URL without the slash).

When you upload an attachment, there is another new option. Expand Zip Files in Uploads will unpack the contents of a zip file and create attachments named as in the file (including directory paths as / separated directory components). The content types of the files will be guessed based on the file extension, so that much basic web site content can be expected to function with little or no tweaking. The expanded files will be set to invisible, so that you can select only relevant starting files for display to the user. Similarly, unpacked files will be set as non-download files, so that they will be displayed by a browser, if it knows how to display their content-type.