in reply to Re: using LWP to download and save an mp3
in thread using LWP to download and save an mp3

Here is the code that shows the way I was trying to save the file.I'll try using the function that you suggested and see if it solves my problem and I'm guessing that it will. Thanks
#!/usr/bin/perl -w use LWP::UserAgent; $ua = LWP::UserAgent->new; $ua->agent('Mozilla/5.0'); my $req = HTTP::Request->new(GET => 'http://sight.com/action.php?id=u1 +VInM4D'); $req->content_type('audio/x-mpeg'); # Pass request to the user agent and get a response back my $res = $ua->request($req); # Check the outcome of the response if ($res->is_success) { open FH, ">file.mp3"; print FH $res->content; close FH; }