Reading files inside zip files from Javascript

  • Thread starter Narendra Sisodiya
  • Start date
N

Narendra Sisodiya

I have some xml files which are zipped. I want to read them using
Ajax (Javascript). may anybody suggest some way to do so??

I otherway, Do http protocol support reading or getting files inside a
zip file?

Something like
http://localhost/MySlideshow.odp{/Images/Thumbnail.png}
??
I want to get such files using Ajax. Do we have any possible solution
at client side where we get one zip file and unzip using Javascript
and read files ?
 
R

rf

Narendra Sisodiya said:
I have some xml files which are zipped. I want to read them using
Ajax (Javascript). may anybody suggest some way to do so??

I otherway, Do http protocol support reading or getting files inside a
zip file?

Something like
http://localhost/MySlideshow.odp{/Images/Thumbnail.png}
??
I want to get such files using Ajax.

If you are using Ajax then you are calling a server side process. Do it on
the server. Zip is fully supported by server side things such as PHP.
 
T

Thomas 'PointedEars' Lahn

Narendra said:
I have some xml files which are zipped,

"Zipped" as in "ZIP archive" (of many files)?
I want to read them using Ajax (Javascript). may anybody suggest some way
to do so??
Yes.

I otherway, Do http protocol support reading or getting files inside a
zip file?

No. HTTP supports transparent gzip compression and decompression, though.
Something like
http://localhost/MySlideshow.odp{/Images/Thumbnail.png}
??

Whether that can work does not depend on the transport protocol, but on the
server side. Certainly the server would need to serve only the image
resource then.
I want to get such files using Ajax.

Possible, but whether the payload can be put to use would probably depend on
the user agent supporting `data:' URLs.
Do we have any possible solution at client side where we get one zip file
and unzip using Javascript and read files ?

Unlikely.

<http://jibbering.com/faq/#posting>


PointedEars
 
M

Michael Haufe (\TNO\)

Possible, but whether the payload can be put to use would probably dependon
the user agent supporting `data:' URLs.

I believe most, if not all major browsers offer a means to obtain a
"binary" string through XmlHttpRequest with or without the use of a
custom overridemimetype.
 
T

Thomas 'PointedEars' Lahn

Michael said:
I believe most, if not all major browsers offer a means to obtain a
"binary" string through XmlHttpRequest with or without the use of a
custom overridemimetype.

Apparently you have not understood what I said. Of course it is possible to
obtain the "binary" string (the payload I was talking about). And then what?


PointedEars
 
M

Michael Haufe (\TNO\)

Apparently you have not understood what I said.  Of course it is possible to
obtain the "binary" string (the payload I was talking about). And then what?

The format of a ZIP file is documented on the interwebs (http://
www.pkware.com/documents/casestudies/APPNOTE.TXT).

If one was so inclined, they could write a decoder to extract the xml
and pass them to a DOM parser in their string form.
 
M

Michael Haufe (\TNO\)

This part of the question was about PNG image data in a ZIP archive.

Indeed, I read too hastily. I concede the comment on the XML portion
and agree with you on the data uri support.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top