To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
PHPBuilder.com  
 

 

Go Back   PHPBuilder.com > Misc Help > ClientSide Technologies

ClientSide Technologies Discuss HTML/CSS/Javascript, and any other client-side technologies, here.

Reply
 
Thread Tools Rate Thread Display Modes
Old 01-26-2006, 05:44 PM   #1
phrygius
Junior Member
 
Join Date: Jan 2006
Posts: 4
JavaScript: creating zip files?

Does anyone know if javascript is capable of creating zip files?

Thanks,
phrygius
phrygius is offline   Reply With Quote
Old 01-26-2006, 07:50 PM   #2
MarkR
Senior Member
 
Join Date: Jul 2004
Location: Oxford, England
Posts: 1,983
Unprivileged client-side Javascript code is not capable of creating FILES, therefore I doubt very much whether it can create zip files.

Privileged code in Mozilla can certainly read from zip files, as the majority of the browser's data is stored in them (jars). Maybe it can write them too. Have a look at XULPlanet.

Client-side script can't create files in MSIE or other browsers either.

Consider creating the file server-side and passing it in a small IFRAME or something (for the client to download)

Mark
MarkR is offline   Reply With Quote
Old 01-26-2006, 09:19 PM   #3
phrygius
Junior Member
 
Join Date: Jan 2006
Posts: 4
Hmmm, if it doesnt have privilege to create an actual file, how about creating a zip stream (similar to what java does)?
phrygius is offline   Reply With Quote
Old 01-27-2006, 12:09 AM   #4
JPnyc
Administrator
 
Join Date: Jan 2005
Posts: 963
Well technically it can, depending on how permissions are set and how patched their windows OS and IE are, but odds are no one in this day and age has permissions set that loose. Javascript can instantiate a windows Scripting.fileSystemObject through the use of ActiveX, but like I said, it's probably not going to work anywhere anymore.
__________________
PHP builder Online Community Manager

JPnyc is offline   Reply With Quote
Old 01-27-2006, 02:42 AM   #5
phrygius
Junior Member
 
Join Date: Jan 2006
Posts: 4
Okay. Yeah, thats what I was thinking being that there's no documentation anywhere on this subject.

But thanks for the replies MarkR and JPync.

-phrygius
phrygius is offline   Reply With Quote
Old 01-27-2006, 06:35 AM   #6
MarkR
Senior Member
 
Join Date: Jul 2004
Location: Oxford, England
Posts: 1,983
Quote:
Originally Posted by phrygius
Hmmm, if it doesnt have privilege to create an actual file, how about creating a zip stream (similar to what java does)?
I don't think you can usefully do that either. In MSIE, you can pretty much forget using any ActiveX to do this sort of thing - it's supported under restricted circumstances in IE6, but it's blocked by a lot of software firewalls and is likely to be disabled by default in IE7.

Moreover, I don't think the API of either Mozilla or IE scriptable activex controls, provides anything which can do zipfile IO in unprivileged script.

In Mozilla, privileged script *MAY* be able to do it, but that is pretty much a none-starter too.

Mark
MarkR is offline   Reply With Quote
Old 01-27-2006, 06:51 PM   #7
Weedpacket
Custom User Title™
 
Weedpacket's Avatar
 
Join Date: Aug 2002
Location: Rapid Offensive Unit "Foreign Object Damage"
Posts: 19,126
If it is just a zip data stream, then it's just a matter of programming even to do it in pure JS. But I don't think anyone's ever bothered to write such a beast (unlike Java, for which a zlib kit exists in the distributed library).
__________________
On two occasions I have been asked [by Members of Parliament], "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
Weedpacket is offline   Reply With Quote
Reply

Bookmarks


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

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
Forum Jump


All times are GMT -4. The time now is 11:15 PM.






Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.