Topic: Pro -When using Download button the download is html not jpg

Hi,

We just installed a pro version on a Drupal 8 site and it is working perfectly except after adding the download button.  when you click on the download button, the download file we get is Juicebox.php.html not jpeg.  Any idea of what we have done wrong?

Thanks for your time!

Re: Pro -When using Download button the download is html not jpg

By default, the Download Button will download the image being displayed in the gallery (using the imageURL from the gallery's 'config.xml' file, the same path that Juicebox uses to display the image in the gallery).

If you have a Multi-Size Image gallery, then the Download Button will download the 'large' size image (the largeImageURL) in preference to the imageURL.

If an image has a linkURL associated with in, then the Download Button will download the file pointed to by the linkURL in preference to all of the above.

Please take a look at your gallery's XML data to check the imageURL, largeImageURL and linkURL entries to see if you can figure out where the problem is originating from.

If you are using the Juicebox module for Drupal, then please note that this is an unofficial plugin which was not written by ourselves.
The gallery's XML data is dynamically generated by the module's code and so, if you are unable to determine the cause of the problem, then it might be worth posting your query in the Drupal forum where the author of the module might be able to help you further.

Also, it might help if I am able to see the problem for myself so if you continue to experience difficulties, please post back with the URL to your gallery's web page so that I can take a look and hopefully help further.
Thank you.

Edit:
As your Download Button seems to be downloading the 'juicebox.php' file (but with an .html file extension), it might be worthwhile checking that PHP is installed and configured correctly on your web server.
The Download Button requires PHP 5.2.0 or later, as noted here (check the 'Web Server' system requirements).

Re: Pro -When using Download button the download is html not jpg

I am having the same problem.  My web server is running PHP Version 7.3.9.  The download button is downloading an html file named juicebox.php.html.  It has this content:

<head><title>Not Acceptable!</title></head><body><h1>Not Acceptable!</h1><p>An appropriate representation of the requested resource could not be found on this server. This error was generated by Mod_Security.</p></body></html>

Here is a link to a juicebox PRO site.

http://jcisaacs.com/PHOTOS/180304-Horse-WEB/

I checked the config file; it is generating a blank linkURL for each image.  I tried deleting that field entirely, did not solve the problem.

Re: Pro -When using Download button the download is html not jpg

I did another check, and found a possible culprit.  I am using Mac OS 10.13.6 High Sierra, and found that the download button is not working, as described in the previous post, when using Safari as the browser.  However, when I use Firefox or Chrome, the download button does work.

Re: Pro -When using Download button the download is html not jpg

I contacted my hosting service.  They tried white listing my IP in Mod_Security, but that did not solve the problem.

Re: Pro -When using Download button the download is html not jpg

@jcisaacs3

I'm sorry to hear that you are having trouble with Juicebox-Pro.
Hopefully my noted below will help.

Thank you for providing the URL to your website
Just for the record, I have been able to successfully use the Download Button in your gallery in all major up-to-date browsers on my Windows 10 PC (Edge, Chrome, Firefox, Internet Explorer, Opera).
It looks like the only browser in which the Download Button fails is Safari.

I notice that your gallery uses Juicebox-Pro v1.5.0.
Please try upgrading your gallery to the latest version (v1.5.1) as many bugs have been fixed since v1.5.0 and upgrading may fix your problem without any further action.
Full instructions for upgrading JuiceboxBuilder-Pro and existing galleries can be found on the Upgrading Juicebox support page.

I realise that the only fix regarding the Download Button listed in the Version History does not seem relevant to your problem but the code for the Download Button has changed since v1.5.0 so upgrading may still be worth a try.

I hope that upgrading your gallery helps.
Otherwise, the error message you see relates to Mod_Security so please check your web server's .htaccess files to see what Mod_Security rules are in place and which might be interfering with Juicebox's download functionality.

Just for clarification, your gallery's 'config.xml' file looks fine (all linkURL entries are blank).
Also, when you say that the Download Button works in Chrome and Firefox, this could be because these browsers use the HTML 5 'download' attribute rather than the PHP implementation of the download functionality. (Juicebox includes both methods of download to support browsers which do not support the HTML 5 'download' attribute.)

In any case, I hope that my notes above help.
Please let me know how you get on and if I can be of any further assistance.

Re: Pro -When using Download button the download is html not jpg

I have been using 1.5.1.  I just sent a link to a smaller site that didn't have photos that I didn't want going public.

Here is one I generated today:

http://justoncephoto.com/PHOTOS/190917- … -FOOD-WEB/

Same problem. 

I'm not sure what to look for in the htaccess files.  I don't see anything related to Mod_Security.

From what I've read, Safari should support HTML5 download.

8 (edited by jcisaacs3 2019-09-21 04:49:31)

Re: Pro -When using Download button the download is html not jpg

I put up an HTML5 download test, and it works with Safari. 

http://jcisaacs.com/TEST/HTML5-Test/HTM … 0Demo.html

Also, I just updated to Safari 13.  Still has the problem; download button not working.

Re: Pro -When using Download button the download is html not jpg

I have been using 1.5.1.  I just sent a link to a smaller site that didn't have photos that I didn't want going public.

OK, thank you for the information.

From what I've read, Safari should support HTML5 download.

I put up an HTML5 download test, and it works with Safari.

Safari does now support the HTML 5 'download' attribute but, at the time the Download Button functionality was written for Juicebox-Pro, it is very possible that it did not (which would explain why Juicebox-Pro uses the PHP implementation for Safari).
In any case, it should work (regardless of the implementation being used).

Check out the Download Button in our demo gallery here.
If this works in your Safari browser, then the problem likely lies somewhere within your web server's set up and the error message you see ("This error was generated by Mod_Security.") certainly suggests that Mod_Security is at the root of your problem. It sounds like a custom Mod_Security rule is interfering with (and blocking) the PHP download process.

Please check in with your web host to find out what custom Mod_Security rules are being applied to your hosting account (and where they are being set).
You may need to temporarily remove them one-by-one (checking the Download Button's functionality after removing each one) to find the Mod_Security rule causing your problem.

If you find that the Download Button does not work in our demo gallery in your Safari Browser, then please let me know and I will notify the developers.
Thank you.

Re: Pro -When using Download button the download is html not jpg

The demo works.  I'll check back with my host site.

Re: Pro -When using Download button the download is html not jpg

Thanks for letting me know. I hope you get on OK.
Please keep me posted.

Re: Pro -When using Download button the download is html not jpg

I have been in contact with my host provider, and their response is "we are not compatible with Safari".  So now I have to go find a host provider that is compatible with Safari.  The one you are using seems to be; can  you tell me which provider you are using?

Re: Pro -When using Download button the download is html not jpg

That's very strange. Even if your web host is incompatible with Safari (which in itself is rather odd), I'd think that they might want to make some changes to ensure that it is compatible, given the number of Safari users out there. (Safari is currently second only to Chrome in the number of users, according to StatCounter, August 2019.)

In any case, looking at the results of an ICANN lookup for 'juicebox.net', I see that the nameservers are ServInt which looks to be an enterprise solution rather than a 'regular' web host. (As you have probably gathered, I personally have no direct dealings with our web host.)

Having said that, I've never heard of a web host that claims to be incompatible with Safari so yours appears to be the exception to the rule and I expect that the majority of web hosts will support both Safari and Juicebox-Pro's Download Button (as long as PHP 5.2.0 or later is installed).

I wish you well in your search for a compatible web host but I really don't think that you should have to look too far.
I'm very surprised by your web host's admission and refusal to try to fix the problem (which could just be a tweak to their Mod_Security settings which they seem to be unwilling to change).

I would hesitate to recommend a web host, though, as one person's experiences may differ greatly to another's.
However, I have free accounts with a few web hosts and I have uploaded a test Juicebox-Pro gallery (featuring the Download Button) to each of them so that you can check out the Download Button's functionality in your Safari browser.

AwardSpace: [Link removed.]
ByetHost: [Link removed.]
x10hosting: [Link removed.]

Please be aware that all the galleries above are on free accounts and you usually get what you pay for.
Paid accounts usually offer more features, greater stability and speed and better support.

Also, please note that I'm not actually recommending any of these web hosts.
This is really just a test to (hopefully) demonstrate that most web hosts will support Safari and Juicebox-Pro's Download Button.

Please let me know how you get on.