Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2007
    Posts
    7

    Unanswered: 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 )

  2. #2
    Join Date
    Mar 2007
    Location
    636f6d7075746572
    Posts
    770
    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.

  3. #3
    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)

  4. #4
    Join Date
    Mar 2007
    Location
    636f6d7075746572
    Posts
    770
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •