Soumya
Soumya

Reputation: 5412

URL of file-download link

I am downloading a file from a location. I would like to get the download link of the file that's being downloaded. I want to save the link in a text file and then later use that link from other places to directly download the object. I am currently working on Firefox, but a generalized approach would be appreciated. Is there a way to do this? I tried JSOUP and I didn't succeed since it was generic to all the external links.

Upvotes: 0

Views: 417

Answers (1)

SeanCannon
SeanCannon

Reputation: 77956

Often times downloaded files do not have source links. For example, say you click a "download" button on a website - it could easily send POST data to a form on a 'download.php' page something like this:

<?php

    header("Content-Type: application/force-download"); 
    header('Content-Description: File Transfer'); 

    readfile($_POST['file']);
?>

Upvotes: 1

Related Questions