Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

118
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda