Download text file from link
Download will be a. Improve this question. TRiG 9, 6 6 gold badges 53 53 silver badges bronze badges. The browser will display the txt file by default, unless you send a Content-Disposition: attachment header. Add a comment. Active Oldest Votes. Improve this answer. Molecular Man Molecular Man 22k 3 3 gold badges 70 70 silver badges 86 86 bronze badges. I quess in ruby it would be response. Subdigger Subdigger 2, 3 3 gold badges 19 19 silver badges 41 41 bronze badges.
You can do this in. If you want it to be for all the. Shef Shef Daniel Daniel 1, 11 11 silver badges 13 13 bronze badges. Fetching a file and display its contents is all well and good, but what if you want to actually save the file to your system? You can check on things with the cat command:. Execute the following command to download the remote robots. Now use the cat command to display the contents of do-bots. If you happened to try to fetch the robots.
You can verify this by using the -I flag, which displays the request headers rather than the contents of the file:. The output shows that the URL was redirected. The first line of the output tells you that it was moved, and the Location line tells you where:. You could use curl to make another request manually, or you can use the --location or -L argument which tells curl to redo the request to the new location whenever it encounters a redirect.
Give it a try:. You can combine the -L argument with some of the aforementioned arguments to download the file to your local system:. PurkkaKoodari PurkkaKoodari 6, 5 5 gold badges 33 33 silver badges 54 54 bronze badges. David David 4, 6 6 gold badges 34 34 silver badges 58 58 bronze badges. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog.
Podcast An oral history of Stack Overflow — told by its founding team. Millinery on the Stack: Join us for Winter Summer? Bash, ! Featured on Meta. New responsive Activity page. Linked 1. Related Hot Network Questions.
Question feed.
0コメント