• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Noddy Question For The Web Types

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    Noddy Question For The Web Types

    Using word press and I want an image to link to a file, but instead of opening it I want the file to download

    I have this but its linking to the file not downloading, any idea what I am missing?

    Code:
    <a href="%fullURLandfilename%.pdf" rel="attachment wp-att-494"><img class="alignnone size-full wp-image-494" src="%fullURLandfilename%.png" alt="some text" width="212" height="248" target="_blank" download=""></a></p>
    Adding the
    Code:
    download=""
    in the past has worked, but this was only on a text link not a image.
    Last edited by SimonMac; 8 February 2016, 21:24.
    Originally posted by Stevie Wonder Boy
    I can't see any way to do it can you please advise?

    I want my account deleted and all of my information removed, I want to invoke my right to be forgotten.

    #2
    Can't you see a null application in the htaccess file so it's won't try and find an application?

    Like
    AddType application/octet-stream .doc

    Or

    <FilesMatch "\.(?idf)$"> ForceType application/octet-stream Header set Content-Disposition attachment </FilesMatch>
    For PDFs for example.
    Last edited by northernladuk; 8 February 2016, 21:39.
    'CUK forum personality of 2011 - Winner - Yes really!!!!

    Comment


      #3
      Shouldn't the download attribute be inside the <a ... > tag?

      Comment


        #4
        Originally posted by Contreras View Post
        Shouldn't the download attribute be inside the <a ... > tag?
        tulip you might be right, just seen its in the image not the file <a....
        Originally posted by Stevie Wonder Boy
        I can't see any way to do it can you please advise?

        I want my account deleted and all of my information removed, I want to invoke my right to be forgotten.

        Comment


          #5
          Cock womble
          'CUK forum personality of 2011 - Winner - Yes really!!!!

          Comment


            #6
            Originally posted by northernladuk View Post
            Cock womble
            I freely admit to being a cock womble, I have never once pretended to be a code monkey
            Originally posted by Stevie Wonder Boy
            I can't see any way to do it can you please advise?

            I want my account deleted and all of my information removed, I want to invoke my right to be forgotten.

            Comment


              #7
              You should also do it as either:

              Code:
              <a href="..." download>link text</a>
              or if you want the file to be named:

              Code:
              <a href="..." download="nice_file_name.pdf">link text</a>

              Comment


                #8
                Originally posted by SimonMac View Post
                I freely admit to being a cock womble, I have never once pretended to be a code monkey
                I would never stoop as low as to call you one of those!
                'CUK forum personality of 2011 - Winner - Yes really!!!!

                Comment


                  #9
                  Another Noddy Question For The Web Types

                  A charity I help out has a website:

                  somerandomenaffnamewith.bthosting.com

                  I have purchased chartiyname.org for them and I want to redirect the new site to the old one, but keep the new name?

                  I tried a .htaccess 301 redirect but that changed the url to the old one as well, is it possible to do what I need while we work out how to move the site to the new hosting?
                  Originally posted by Stevie Wonder Boy
                  I can't see any way to do it can you please advise?

                  I want my account deleted and all of my information removed, I want to invoke my right to be forgotten.

                  Comment


                    #10
                    Use the Wordpress plugin?

                    https://wordpress.org/plugins/redirection/
                    'CUK forum personality of 2011 - Winner - Yes really!!!!

                    Comment

                    Working...
                    X