File download function

Is there a simple function to download the image being viewed?
The usual type of download that drops the downloaded file into a folder on your computer?
The ZPBase theme I am using has a Download written in to the image.php but all you get if you click on this link is a fullpage view of the file (from which you can indeed download the image by right clicking) - but I would like a download button which would download the file to the viewer's computer.

http://www.eggsa.org/copied_postcards/france/Albi/Albi_+The+Saint+C_cile+Cathedral.jpg

I have found this function:
function printDownloadURL($file, $linktext = NULL)
531: * Prints a download link for a file, depending on the plugin options including the downloadcount and filesize
532: * @param string $file the path to a file to print a download link.
533: * @param string $linktext Optionally how you wish to call the link. Set/leave to NULL to use the filename.

but it doesn't seem to work - what would I insert as the $file parameter?

Thanks,
Richard

Comments

  • acrylian Administrator

    the path to a file

    So the full url that for example getFullImageURL() returns.

  • Thank you for your quick reply - that did now work in this instance either - but I discovered that what I needed to make it work was an option setting in the image options to allow downloads !!
    Simple when you can find out how!
    Many thanks,
    Richard

Sign In or Register to comment.