Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

119
Views
I don't want the user to get the file directly from the url

For example:

url(`https://example.com/file.exe`)

If a user visits this website directly, the user will be redirected to https://example.com/getfile.html but allow the user to get the file if the user gets the file from <a> tag of https://example.com/getfile.html

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can achieve this by removing href attribute in anchor tag and adding onclick function to the anchor tag. In onclick function send some parameter in url to get that value in your html page when user visits the page.

Click here to know how to send parameter in url.

Click here to know how to get post parameter from the url .

Still you have any confusion, you can comment your questions to this answer.

If you are using php you can get post parameter from url in a single line of code by using $_REQUEST["your post parameter name"];

I am adding a simple example for this to achieve with simple html and jquery.

with jquery document.referrer method on document ready(when user opens a page), you can get the previous url of user visited. like bellow example. for this you need to include jquery in your page by following line inserting in your page.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
  console.log(document.referrer);
if(document.referrer == "your url") {
    your code to allow user if comes from the url you mentioned //user will get download button or you can write direct download option;
} else {
     window.location = "some url";   //you can redirect user to specific url
}
});
<script>

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!