Welcome to TalkGraphics.com
Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 23

Thread: Download Button

  1. #11
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    11,754

    Info Re: Download Button

    Quote Originally Posted by Turan Mirza View Post
    Thanks Egg ,that's kind of what I have right now, the problem is imbedding it in an icon or button. right now I have to upload the image to the folder separately.
    The code for this, should it work, is quite simple.

    Load the image onto the page.
    Give it a special Name of filename="anxietyrelief" (Xara provides the jpg). In v17, you can use Image Filename instead. Do ensure JPEG is forced in the same dialog.
    Clone in and in its Placeholder Body Code and add in:
    Code:
    <a href="https://www.feel-good.today/downloads/Anxiety%20Relief%20by%20Feel%20Good%20Hypnosis.mp3" download><img src=""index_htm_files/anxietyrelief.jpg" width="100%" height="100%" /></a>
    You now should have an invisible overlay with a click link so put the image underneath.

    Perhaps you can add similar code toy your working version.

    Acorn
    Acorn - installed and active Xara software: Cloud+/Pro+, XDPX, XWD Premium 15 & 12, XPGD10, X3D7, Xara Xtreme 5, back through time (to CC's Artworks).
    Raise software faults with MagiXara: http://support.magix.net/; if Cloud+/Pro+: https://xara.com/contact-us/

  2. #12
    Join Date
    Aug 2000
    Location
    Harwich, Essex, England
    Posts
    19,744

    Default Re: Download Button

    Thanks Acorn. Another method I found was changing the .htaccess file to include:

    Option 3: You can add the following lines of code in your .htaccess file of your server to force a download of a particular file type from your server (in this example it is for PDF file types):

    <FilesMatch "\.(?i:pdf)$">
    ForceType application/octet-stream
    Header set Content-Disposition attachment
    </FilesMatch> You can change "pdf" to any other file type based on your need (example: mp3, mp4, doc).


    Source:
    http://www.tipsandtricks-hq.com/forum/topic/force-a-file-to-download-instead-of-showing-up-in-the-browser


    Egg

    Intel i7 - 4790K Quad Core + 16 GB Ram + NVIDIA Quadro 2000 Graphics Card + Samsung 970 EVO Plus 500GB SSD + 232 GB SSD + 250 GB SSD portable drive
    Xara Designer Pro X 17 + Xara 3D Maker 7

  3. #13

    Default Re: Download Button

    Hum - I'm getting a "broken image" icon on the overlaid image that has the placeholder as shown here.Click image for larger version. 

Name:	image.jpg 
Views:	13 
Size:	82.4 KB 
ID:	126903

  4. #14
    Join Date
    Aug 2000
    Location
    Harwich, Essex, England
    Posts
    19,744

    Default Re: Download Button

    Works fine for me Turan.

    I'll attach my xar file (It doesn't work correctly in preview but works as expected if on a server)

    LINK
    Attached Files Attached Files
    Egg

    Intel i7 - 4790K Quad Core + 16 GB Ram + NVIDIA Quadro 2000 Graphics Card + Samsung 970 EVO Plus 500GB SSD + 232 GB SSD + 250 GB SSD portable drive
    Xara Designer Pro X 17 + Xara 3D Maker 7

  5. #15

    Default Re: Download Button

    Tried it with my my icon then quickly tried your image on my page - both are still getting the broken image icon - tested in both chrome and edge. What I have not done is change my .htaccess file yet. But reading above felt that was a either do this or do that.Click image for larger version. 

Name:	image.jpg 
Views:	13 
Size:	99.3 KB 
ID:	126906
    Last edited by Turan Mirza; 29 April 2020 at 10:17 PM.

  6. #16

    Default Re: Download Button

    Started from scratch and it's all working now. Not sure what I was doing wrong but with all the tests must have messed up somewhere. But working now.


    Thanks for the help guys.

  7. #17
    Join Date
    Aug 2000
    Location
    Harwich, Essex, England
    Posts
    19,744

    Default Re: Download Button

    Glad you sorted it. The .htaccess method is only another option, but after Acorns help you wont need it now.
    Egg

    Intel i7 - 4790K Quad Core + 16 GB Ram + NVIDIA Quadro 2000 Graphics Card + Samsung 970 EVO Plus 500GB SSD + 232 GB SSD + 250 GB SSD portable drive
    Xara Designer Pro X 17 + Xara 3D Maker 7

  8. #18
    Join Date
    Apr 2003
    Location
    Canton, Mi USA
    Posts
    206

    Default Re: Download Button

    Thank you all for sharing!
    I had not logged into this forum in years!
    but now helping my brother on his site has brought a lot of joyful memories...
    so to the point:
    How about an image that "triggers" a download (a PDF in my case, and as you all have so expertly explained) then re-directs you to another page?
    Must be SUPER Simple but I'm stuck...

  9. #19
    Join Date
    Aug 2000
    Location
    Placitas, New Mexico, USA
    Posts
    38,226

    Default Re: Download Button

    Wouldn't this direct download trigger some anti-malware programs? The idea of the save or open option gives the user the choice.
    Gary W. Priester
    Mr. Moderator Emeritus Dude
    , Sir

    gwpriester.com | Custom-Stereograms.com | eyeTricks on Facebook






  10. #20
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    11,754

    Default Re: Download Button

    Quote Originally Posted by esanabri View Post
    Must be SUPER Simple but I'm stuck...
    It isn't. You would have to revert to JavaScript to called the download and then open another window.
    Go for a simpler click to open a pop-up where the Download can be selected and the jump can be picked. All user-selected.
    Acorn
    Acorn - installed and active Xara software: Cloud+/Pro+, XDPX, XWD Premium 15 & 12, XPGD10, X3D7, Xara Xtreme 5, back through time (to CC's Artworks).
    Raise software faults with MagiXara: http://support.magix.net/; if Cloud+/Pro+: https://xara.com/contact-us/

 

 

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
  •