sorry if, this question seems simple, but I have been searching for a while now and have not found an answer that can be applied to my situation.
I wrote a little perl script that uploads a file to a server. This server responds with a:
HTTP/1.1 200 OK
It wasn't until I read the response as string:
print $res->as_string, "\n";
that I saw that the server seemed to have attached his response in a file:
Content-Disposition: attachment; filename=filename.txt
How do I get to the content of this .txt file using perl?
The
Content-Disposition
header in the HTTP response is mainly a hint for browsers to save the file as download namedfilename.txt
. You can access the file just like the content of every other HTTP response:or
I assume you use
LWP::UserAgent
.