CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Kanji Help - Unzip Problem

 



chrissyk
Deleted

Sep 27, 2000, 11:26 PM

Post #1 of 5 (624 views)
Kanji Help - Unzip Problem Can't Post

I am trying to unzip a zip file from CGI and I am running into a problem.

I copied your script found here on the forum, and after downloading and installing unzip.exe, I attempted to run it.

Here is the script that I have:

#!/perl/bin/
$|++;
system( "c:/zip/unzip.exe", "d:/WebSites/Developers/Chrissy/Emergence-design/benedek/temp/bim.zip" )&& print "Oh dear: $!";

This is the output of the script.

CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:


Archive: d:/WebSites/Developers/Chrissy/Emergence-design/benedek/temp/bim.zip
checkdir error: cannot create weather
unable to process weather/.
checkdir error: cannot create weather
unable to process weather/images/.
checkdir error: cannot create weather
unable to process weather/images/radara3.gif.
checkdir error: cannot create weather
unable to process weather/images/thumb-radara3.gif.
checkdir error: cannot create weather
unable to process weather/images/radara4.gif.
checkdir error: cannot create weather
unable to process weather/images/thumb-radara4.gif.
checkdir error: cannot create weather
unable to process weather/images/radarb2.gif.
checkdir error: cannot


I have write access set, so I can't figure out why it would have problems creating a directory... so I created the directories in the extraction tree for it... I still get the same error!

Any ideas? I'm lost and getting VERY frustrated... Please help me!

Chrissy

PS
Bottom line is I need to figure out a way to do this, so if we need to go with a whole other way of doing this, that is fine.


Kanji
User / Moderator

Sep 29, 2000, 4:39 PM

Post #2 of 5 (624 views)
Re: Kanji Help - Unzip Problem [In reply to] Can't Post

Are you 100% sure of where you are unzipping to? Do you have write access there?


chrissyk
Deleted

Sep 29, 2000, 5:21 PM

Post #3 of 5 (624 views)
Re: Kanji Help - Unzip Problem [In reply to] Can't Post

Hi,
If this is the location where the script would write (d:/WebSites/Developers/Chrissy/Emergence-design/benedek/temp/)(In other words extracting starting where the zip file is located), I have tried everything right up to full access. It definitely has write access, but no go.

If it is trying to write the files from where the location of Unzip is (c:/zip/), then no it doesn't. How does the script work... from the way it is written, where would it be writing the files and creating the directories? I even created the directories for it and made sure they had write access.... pretty weird!

Thanks for your help in advance!

Chrissy


Kanji
User / Moderator

Oct 1, 2000, 4:25 PM

Post #4 of 5 (624 views)
Re: Kanji Help - Unzip Problem [In reply to] Can't Post

Either find out where you really are (see Cwd.pm) or avoid assumptions and explicitly change to the directory you want (chdir) before doing your business.

Also, you may want to look at Archive::Zip for a more perl(ish) interface to zip.


Kanji
User / Moderator

Oct 2, 2000, 11:06 AM

Post #5 of 5 (624 views)
Re: Kanji Help - Unzip Problem [In reply to] Can't Post

You know, I wonder if those slashes aren't getting turned into backslashes as I doubt unzip.exe will no what to do with /'s.

Yeah, yeah, I know I told you perl is smart enough to change /'s to \'s on Win32 systems, but I don't recall if that applies to calls via system(), exec(), et al. and I don't have access to a Win32 system right now to test.

So you may want to try ...

<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>

system( qw(c:\zip\unzip.exe d:\WebSites\...\bim.zip) );</pre><HR></BLOCKQUOTE>

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives