Solved

Archive Zip Module

Posted on 2004-08-05
3
265 Views
Last Modified: 2013-12-25
Hi

I am using the archive zip module too view whats inside zip files. Using this code:

 use Archive::Zip;
use Archive::Zip::MemberRead;

  $zip = new Archive::Zip("testdate.zip");
  $fh  = new Archive::Zip::MemberRead($zip, "testdate.txt");
  while (defined($line = $fh->getline()))
  {
      print $fh->input_line_number . "#: $line\n";
  }  $read = $fh->read($buffer, 32*1024);
  print "Read $read bytes as :$buffer:\n";

Though if the file is not my sever, but another address example
  $zip = new Archive::Zip("http://www.xx.com/test/testdate.zip");

Then it does'nt work!, anyone know how to get it get to work?

Thanks

Akbar
0
Comment
Question by:akzah
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 48

Accepted Solution

by:
Tintin earned 100 total points
ID: 11748903
Archive::Zip works with files, not URI's, so you need to download the zip file first, eg:

use LWP::Simple;
getstore('http://www.xx.com/test/testdate.zip','/some/path/testdate.zip');
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This tutorial will give you a fast look what you can do with WhizBase. I expect you already know how to work with HTML at least, and that you understand the basics of the internet and how the internet works. WhizBase is a server-s…
It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
The viewer will learn how to count occurrences of each item in an array.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question