Unzip & zip

A

Anonymous

Guest
My idea is to zip a file (any type) then upload to server. After that, when users visit, they can download them or unzip and view online.
I use PHP 4.34 & MySQL and Apache server.
Any idea?
 
ndtoan13 said:
My idea is to zip a file (any type) then upload to server. After that, when users visit, they can download them or unzip and view online.
I use PHP 4.34 & MySQL and Apache server.
Any idea?

What does this have to do with PHP? Zip the file and upload it to your server just like any other file.
 
Yes, Zip file by hand then upload is normal.
But I want to select files then zip them by PHP, of course store in server.
(It's about zlib or something like that)
Second, when user click a link to zip file, it open save file window as usual.
What I want is to display content of a file, so I must unzip it :).
Do you have any idea? :help:
 
you would need some command line zipper, then you can use exec() to arcive them...
 
continuing my reply, PHP is a server-side language, you can archive a file that is on your server, but you cant arcive a file that is on someone elses computer and then upload it to server. If you are talking about your own computer, then you can run the script that will archive the file using a command-line archiving tool, and then upload it to the server, but you will need an archiver on the server to unarchive the file. But why even bother going through all that? unless your files are over 10-15 megabyte in size, and a text tile that large can contain a small library, it would be faster and more efficient to upload them as just pure text files.
 
Thanks Alex, it's my mistake. There is noway to archive files in client.
Actually, my friend have made an application (in JSP) that archive selected posts (or text, etc.. in xml format) then save in clients (it looks like backup method) whenever you want you can upload them to server, it's automatic display its content (of course it must unarchve files). So I think there is no problem with PHP !
 
Back
Top