Attachment


The Attachment icon in the Dreamweaver object palette

With this WebYep Element you can attach arbitrary documents to a web page, offering them for download. The user can upload some document (a Word© document or PDF file) and the Attachment Element will create a download link (using the document filename) for it - by clicking on it, visitors can download the document.

This element is represented by the following PHP code:

<?php webyep_attachment("Fieldname", false); ?> more...

Arguments for the webyep_attachment() PHP function call:
(see "Attributes of the Attachment Element" below for details)
  1. "Fieldname": A string, the field name for this element.
  2. true/false: A boolean – the scope for this element.
    true if the element should have the same content on all pages (global).
    false if it should have different content on each page it appears on.

WebYep does its best to make sure that browsers really download the document and do not display it directly, which is what they tend to do, if a suitable plugin is installed, but is not what is wanted here. Unfortunately not all browser conform to the relevant internet standards (defined in the HTT protocol specification) and thus some of them (e.g. Safari pre Mac OS X 10.4) might nevertheless display the document instead of starting a download.

File size

The size of the uploaded file is limited by two parameters:

1. The PHP configuration of your provider. The provider running the webserver can set various limits to uploads done via PHP. Usually they are set around 2MB - WebYep tries to figure out that limit and displays it in the file upload window.

2. The internet connection speed. If an upload takes too long (due to rate if file size to internet connection speed), the browser or server might interrupt the upload process. What exactly "too long" means, depends on a lot of factors (which browser, which version, which OS, etc.), but a file size of 1-2MB can be considered save in most situations. It is also important to note that this limit affects only the upload by the user, not the download done by the visitors.


The Attachment Element in action.
Clicking the "Edit" button opens the File Upload Window.


The File Upload Window.


To Top of Page

Attributes of the Attachment Element


The Dreamweaver inspector showing the Attachment Element's attributes

Fieldname

A distinctive name for that element. This name will be displayed in the page in edit mode to give the user a hint on what this elements content stands for and to distinguish the different WebYep Elements in a page.

When displaying the download link for the document, WebYep will not use this name as the link text, but will instead use the filename of the uploaded document.

Content

When set to "for this doc only" the elements content is unique for this page - even if another element on a different page has the same name. If set to "for all documents" the content will be the same on all pages for elements of this kind that use the same name.


To Top of Page
© 2009, Objective Development