There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
NameSpace doesn't like zip file in ASP


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
amallen's Avatar
Member with 30 posts.
 
Join Date: Jul 2004
Experience: Intermediate
14-Mar-2008, 05:12 PM #1
NameSpace doesn't like zip file in ASP
I have a vbscript that creates an empty zip file and then loads a couple of files into it for eventual download. As a stand-alone vbscript it works fine but when I add the code to an ASP page the code chokes on the NameSpace object. So I can create the empty zip file but I can't add any files to it.

Here's the code:
Dim zipFile, objFSO, objTxt, objApp
zipFile = "D:\ArcIMS\Output\SavedMapImages\aaa.zip" 'The path and name of your zip file

'Create an empty ZIP file
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objTxt = objFSO.OpenTextFile(zipFile, 2, True)
objTxt.Write Chr(80) & Chr(75) & Chr(5) & Chr(6) & String(18, Chr(0))
objTxt.Close

'Copy the files into the ZIP file
Set objApp = Server.CreateObject("Shell.Application")
objApp.NameSpace(zipFile).CopyHere("D:\ArcIMS\Output\SavedMapImages\aaa.png ")
objApp.NameSpace(zipFile).CopyHere("D:\ArcIMS\Output\SavedMapImages\aaa.pgw ")

It's the NameSpace object in the last two lines that throw errors. And it's the zip file itself that causes the error; I don't get an error if I use a basic folder path.

Does anybody have a solution?

Thanks,

Aaron
Lazwolf's Avatar
Junior Member with 1 posts.
 
Join Date: Apr 2008
10-Apr-2008, 09:10 AM #2
I'm experiencing the same issue.

When running the site on my Windows Vista machine the zip file is created fine but once it runs on Windows server 2003 it creates the zip file but falls over when copying the file to it.

When I try to open this empty zip file from my Vista machine it opens fine.
When opening the same file from the server using AlZip I get an error message that it has corrupted headers.
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 10:19 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.