开发者

URL of file-download link

开发者 https://www.devze.com 2023-03-19 07:25 出处:网络
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 plac

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 Fir开发者_运维技巧efox, 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.


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']);
?>
0

精彩评论

暂无评论...
验证码 换一张
取 消