Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: HTTP::Response parse and save attached zip file.

by thomas895 (Deacon)
on Oct 05, 2015 at 18:45 UTC ( [id://1143848]=note: print w/replies, xml ) Need Help??


in reply to HTTP::Response parse and save attached zip file.

Please move the code into your question, it makes it easier to read while responding.

When you run that code, what happens? Do you get an error message? What does it say? How have you tried to fix it?
If you don't get an error, how does the result differ from what you expect? Does your zip library of choice support extraction from memory?

-Thomas
"Excuse me for butting in, but I'm interrupt-driven..."
  • Comment on Re: HTTP::Response parse and save attached zip file.

Replies are listed 'Best First'.
Re^2: HTTP::Response parse and save attached zip file.
by sharprez (Novice) on Oct 05, 2015 at 19:39 UTC

    Code moved to question per thomas895, thank you.
    The data shown (GotToBTru), is the response.

    What module would best parse the content to extract the attached binary Zip file?

    Good questions thomas895;
    When you run that code, what happens?
    I can see the data (shown in question). But I can't get parts to give me the second multipart message (mime) which contains the Zip file.
    Do you get an error message?
    No error message that I am aware of (apache log, or in browser)
    What does it say? N/A
    How have you tried to fix it?
    I can get my script to display the response data (shown in question), saved as binary, when I open the response mime file in my thunderbird email, the zip file is there, but it is corrupt (wrong size too).
    If you don't get an error, how does the result differ from what you expect?
    I cant get to the Zip file. I want to extract it and save it to a file.
    Does your zip library of choice support extraction from memory?
    I dont have one yet... I am considering Archive::Zip.

    Thanks for your replies. :)

      I was able to get the zip file out of my response data. Although I'm very happy about that, I'm not sure I have a full understanding of why it wouldn't show when I parsed the data. Thank you Dumper! :) $zipfile in the code below did have my zip file intact...I unzipped and had good data. Time for a coffee break and contemplation!! :) :)

      my $parser = MIME::Parser->new(); $parser->output_to_core(1); my $ref = $parser->parse_data(\$xmltrans); my $zipfile = $ref->{ME_Parts}[0]{ME_Bodyhandle}{MBS_Data};

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1143848]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-04-23 11:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found