Member
Member
RichardB   2018-10-10, 07:55
#1

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

Administrator
Administrator
acrylian   2018-10-10, 09:00
#2

the path to a file

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

Member
Member
RichardB   2018-10-10, 10:00
#3

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

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.