Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Data Access, Manipulation & Batch Languages > PHP > PHP to upload/download zip/rar files (was "can you help me ?")

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-08-07, 14:11
tinhbanghuu tinhbanghuu is offline
Registered User
 
Join Date: Apr 2007
Posts: 7
PHP to upload/download zip/rar files (was "can you help me ?")

I'm coding web sites with languages are PHP and MySQL , and i have problem

1) Suppose i want to upload 3 file ( ex : *.doc ) on server . Can you tell me how do i coding PHP to uploading finish, 3 file will automat compress .( zip or rar )

2) Suppose i have 3 files to download ( ex : *.doc or pdf ) , and i had 3 this links. Can you tell me how do i coding PHP to downloading finish , 3 file will automat compress .( zip or rar )
Reply With Quote
  #2 (permalink)  
Old 10-11-07, 10:25
aschk aschk is offline
Registered User
 
Join Date: Mar 2007
Location: 636f6d7075746572
Posts: 734
So in the first example you want to compress your files into zip or rar archives after a user has uploaded?
And in the 2nd example you want to compress the files before? or after? the user has downloaded?

You can use the linux/unix zip function to do what you're after, and the unzip for the inverse.
Reply With Quote
  #3 (permalink)  
Old 10-11-07, 10:51
tinhbanghuu tinhbanghuu is offline
Registered User
 
Join Date: Apr 2007
Posts: 7
thanks . I want to compress my files into zip after a user has uploaded and comprenn my file after a user downloaded , but i want to use php function ( not linux or unix)
Reply With Quote
  #4 (permalink)  
Old 10-15-07, 05:54
aschk aschk is offline
Registered User
 
Join Date: Mar 2007
Location: 636f6d7075746572
Posts: 734
PHP has NO native compression utility. You may find some luck with Pear but i doubt it. From what I have seen about what is available the PEAR bits only allow you to read compressed files, not actually create them. You WILL have to use the unix binaries to do what you're after.

Also uncompressing a file "after" download is not automagically possible, especially where PHP is concerned. Self-extracting files are possible, but to be honest you're better off relying on the client having winzip or an alternative program.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

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