in reply to Missing filename header

Have you read LWP::Simple? What filename to you expect the file to be stored in? Where does that filename come from?

My guess is that if no filename is given by the program, LWP::Simple::getstore will fall back on the Content-Disposition header and the filename supplied there. But the error message suggests that the page is sending no such header.

My suggestion is that you inspect the headers you get back, and also look at the content that is returned by that URL. If all else fails, why don't you manually supply the filename?

Replies are listed 'Best First'.
Re^2: Missing filename header
by Anonymous Monk on Mar 21, 2019 at 12:12 UTC
    HI Corion,

    I have given that filename as I wanted to store it by that name.

    I checked with the head($url) method of LWP::useragent, which returns nothing.

    why don't you manually supply the filename?
    Can you tell me, how do we do that.

    Thanks.

Re^2: Missing filename header
by Anonymous Monk on Mar 21, 2019 at 13:04 UTC

    I also tried with below, but it doesn't seem to be working.

    print "Content-Type:application/vnd.microsoft.portable-executable\n"; print "Content-Disposition:attachment;filename='BCM_console.exe'\n\n";