Hide a download link

Posted on 2012-08-31
Last Modified: 2012-08-31
On my site I have a form that users fill out with contact information. Once they fill it out I display the link to a pdf file that is hosted on another site for the users to download.

Unfortunately this link has been shared around and people aren't providing their contact information.

I need a way in either or Javascript to do the file download without showing the link so I can force more people to provide their contact info.

I can get the owner of the other site to change the link but contractually the pdf file has to live on their website.

Can anyone point me to some ideas?
Question by:EndeavorToPersevere
    LVL 31

    Accepted Solution

    A very simple idea is

    <a href="#" onclick="location.href='' ">

    The URL is not displayed to the user, to get the URL they would have to go through the code.

    Assisted Solution

    Question: Contractually it has to reside on their server...
    But can your server read it from their server and then deliver it to the user?

    If so, then your server can  programmatically create a URL that's good for..say 30mins
    When you hit it, the ASP script checks the expiration based on filename or lookup table in database or memory and if it's still good, downloads the file from source server and delivers to customer...(Twice the download time)

    If you contractually cannot do that, then...
    You can only hide it so far...

    You can program links that live and die (expire) on your server that redirect to the final link.
    But anyone with half a brain will pick up on the redirect and find the true link.
    LVL 2

    Author Closing Comment

    Thanks for the ideas.

    Unfortunately I can't read the other server but thankfully this doesn't really have to be that secure we are just encouraging more people to provide contact info. So if they want to view the source code to get the link or email the pdf once they have it so be it.

    I'll use your ideas to make it a bit more secure and hopefully get more link registrations.

    LVL 20

    Expert Comment

    Can the link of the pdf be shared? What happens if the link to pdf file is shared?

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
    A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now