Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9033329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T08:12:15+00:00 2026-06-16T08:12:15+00:00

I have seen only one question on here but it does not answer my

  • 0

I have seen only one question on here but it does not answer my question. I am running a typical LAMP server that has the most up to date PHP 5 and MYSQL 5 with Redhat Linux.

I need to find a PHP only solution because my host does not allow me to use shell.

Here is my code that extracts ZIPs that are not passworded from vBulletin uploads to another directory:

if ($_GET['add'] == TRUE){
$zip = new ZipArchive;
 $res = $zip->open($SOURCE FOLDER);
 if ($res === TRUE) {
     $zip->extractTo('$DESTINATION FOLDER/');
     $zip->close();
     echo 'File has been added to the library successfuly';
     //Add a flag to that file to indicate it has already been added to the library.
     mysql_query("UPDATE attachment SET library = 1 WHERE filedataid='$fileid'");    
 } else {
     echo 'A uncompression or file error has occured';
 }}

There must be some way to do this using just PHP, surely! Thank you.

UPDATE: My host informs me that gzip is installed on the server but not 7-Zip. I am looking into shell access too.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T08:12:16+00:00Added an answer on June 16, 2026 at 8:12 am

    Have 7zip executable available to the script and call it to uncompress the file with the password via system().

    $strCommandLine = "7z e fileToUnzip.7z -pTHEPASSWORD";
    system($strCommandLine);
    

    You can do something similar with unzip, if your host has that installed. See http://linux.about.com/od/commands/l/blcmdl1_unzip.htm.

    It supports -P with a password, so something like this:

    $strCommandLine = "unzip fileToUnzip.7z -P THEPASSWORD";
    system($strCommandLine);
    

    Caveat: someone could see your password on that command line if they do a ps on the system and see your unzip command running.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have seen XML Schema element with attributes containing only text but I have
I am new here and new to windows mobile development. But I have seen
So I have been here before asking about this issue but no one has
I have seen a question on here about this however it was old so
I have a problem that I have not seen addressed in this particular way
Possible Duplicate: Mobile site - force landscape only / no auto-rotate I have seen
I have seen some people in SO commenting that Singleton Pattern is an anti-pattern.
I have seen behaviour in Perforce that I am unable to explain. I took
I have seen questions posted on here asking how to left and right align
I have seen this talked about but never answered. Maybe it has and I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.