Welcome to TalkGraphics.com
Results 1 to 9 of 9
  1. #1

    Default Create a "Save As" prompt for photos?

    How can I create a "save as" prompt for people to download high resolution images from my webpage? I have the images and the "download" buttons beneath each one, I just can't seem to find the way to get the prompt to occur when you click each download button. Note" I added the images to each download button by using the "Link to file" option (for PDF's etc) but all that does is create a popup of the image with no prompt to save.

  2. #2
    Join Date
    Aug 2000
    Location
    Placitas, New Mexico, USA
    Posts
    41,502

    Default Re: Create a "Save As" prompt for photos?

    I'm sure one of the more code savvy members will have the answer but here is one place to start https://duckduckgo.com/?q=Code+for+b...&t=ffsb&ia=web

  3. #3
    Join Date
    Apr 2010
    Location
    Kildare, Ireland
    Posts
    906

    Default Re: Create a "Save As" prompt for photos?

    HTML5 has a download attribute you can use on a link but I don't think there is anyway to apply this in Xara so I think you would have to use a placeholder with some custom html code. https://www.w3schools.com/tags/att_a_download.asp

    There are likely javascript methods too but I don't know any off hand.
    XT-CMS - a self-hosted CMS for Xara Designers - Xara + CMS Demo with blog & ecommerce shopping cart system.

  4. #4
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,814

    Default Re: Create a "Save As" prompt for photos?

    Nowhere near building this so far, but along the lines of:

    To the image add Name of htmlClass="download".
    Add a Name of UsesJQuery to any such image.
    To the image link, use a link to the required image location.

    In the Website HTML Code (head), include:

    <CODE> $('.download').each(function() {
    $(this).attr('download',$(this).text());
    var $download = $(this).attr('download');

    if (typeof $download !== typeof undefined && $download !== false) {
    var $el = $('<div>').addClass('download-instruction').text('Right-click and select "Download Linked File"');
    $el.insertAfter($(this));
    };
    </CODE>

    Add some CSS to make the instruction stand out.

    ================

    This allows the click on the image to download it for suitable browsers.
    For those without, a fresh link and instruction appears.

    Lots of tweaking and testing to make this work so dopn't hold you breath, unless someone else steps in and delivers.

    Acorn
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  5. #5
    Join Date
    Aug 2000
    Location
    Harwich, Essex, England
    Posts
    21,916

    Default Re: Create a "Save As" prompt for photos?

    Or use the ww3 example Tom points to. Create a folder named images on your server and put whatever images you want downloadable into it.

    In Xara create a placeholder with the following code:

    <a href="http://www.yoursitename.com/images/all-roads.jpg" download>
    <img border="0" src="http://www.yoursitename.com/images/all-roads.jpg" alt="All Roads" width="958" height="719">
    </a>

    EXAMPLE
    Egg

    Intel i7 - 4790K Quad Core + 16 GB Ram + NVIDIA Geforce GTX 1660 Graphics Card + MSI Optix Mag321 Curv monitor
    + Samsung 970 EVO Plus 500GB SSD + 232 GB SSD + 250 GB SSD portable drive + ISP = BT + Web Hosting = TSO Host

  6. #6
    Join Date
    Aug 2000
    Location
    Placitas, New Mexico, USA
    Posts
    41,502

    Default Re: Create a "Save As" prompt for photos?

    Brilliant Egg, and Tom and Acorn.

    I have the images and the "download" buttons beneath each one, I just can't seem to find the way to get the prompt to occur when you click each download button.
    So trnhockey would insert this script to a button instead of the photo?

    No. Just tried this. How would one link a button to do this?

  7. #7
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,814

    Default Re: Create a "Save As" prompt for photos?

    Egg, the point is it doesn't work for all flavours and versions of browser.
    It is also very tedious to have to code into a Placeholder repeatedly.

    Acorn
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  8. #8
    Join Date
    Aug 2000
    Location
    Harwich, Essex, England
    Posts
    21,916

    Default Re: Create a "Save As" prompt for photos?

    Gary, create a button image & place this into the image folders also.
    Create a rectangle & give it the following placeholder code:
    <a href="http://www.mywebsitename.com/download/images/all-roads.jpg" download>
    <img border="0" src="http://www.mywebsitename.com/download/images/download-button.png" alt="Egg" width="158" height="56">
    </a>
    You can duplicate this button and just change the end of the first line to the match the name of the image to download.

    I get Acorns point re older browsers.

    LINK 2


    Egg

    Intel i7 - 4790K Quad Core + 16 GB Ram + NVIDIA Geforce GTX 1660 Graphics Card + MSI Optix Mag321 Curv monitor
    + Samsung 970 EVO Plus 500GB SSD + 232 GB SSD + 250 GB SSD portable drive + ISP = BT + Web Hosting = TSO Host

  9. #9
    Join Date
    Aug 2000
    Location
    Harwich, Essex, England
    Posts
    21,916

    Default Re: Create a "Save As" prompt for photos?

    Further refined. This page is not downloading the smaller image in the Xara created page, but the lager one within the "images" folder:

    LINK 3
    Last edited by Egg Bramhill; 23 June 2017 at 09:56 PM.
    Egg

    Intel i7 - 4790K Quad Core + 16 GB Ram + NVIDIA Geforce GTX 1660 Graphics Card + MSI Optix Mag321 Curv monitor
    + Samsung 970 EVO Plus 500GB SSD + 232 GB SSD + 250 GB SSD portable drive + ISP = BT + Web Hosting = TSO Host

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •