Solved

Archive Zip Module

Posted on 2004-08-05
3
276 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

This article will show, step by step, how to integrate R code into a R Sweave document
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

617 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