Skip to main content

Downloads

Downloads

 

Eonicweb has an extra library to assist with downloads.

There is nothing to stop the web developer linking directly to a url for a specific file to allow it to be downloaded. However this will not check the permissions a user has to view a file and exposes the full path to the file which may not be desirable.

An alternative is to send a request to

/ewcommon/tools/download.ashx?docId=number

Where number is the id of the item of content that references the download.

The relative path to the document to download needs to be stored at the location "/Content/Path" alternatively this can be specified in the url as follows...

/ewcommon/tools/download.ashx?docId=number&xpath=/Content/Path

The content Path can be specified in both the brief and the detail, both are checked.

If you want to download multiple files as a ZIP then simply comma separate the docId value.

By default the zip file will be named download.zip if you want an alternative name append &filename=yourfilename.zip on the url request

NOTE:

At the moment no permissions are checked, we have plans to add a config setting to allow permissions for the download to be checked based on the permissions on the parent page for the content item.

We also want to allow the docs directory to be located outside the wwwroot so as not to be physically available to download directly.

If anyone has an immediate requirement for these features please let us know.