473,400 Members | 2,145 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,400 software developers and data experts.

Load password protected Zip files dynamically

I’m almost there. Almost there -- almost there I tell you. In the last 24h (literally -- I haven’t slept at all) I learnt PHP 5.2 Zip stuff, mcrypt, and a little about how to launch external programs from php. (exec/system).

Now. My problem.

I have a zip protected file, that I need to load “on demand”, so that I can stream its content.

TheZipFile.zip
|-- secretStashOfSecretFiles

I can load the zip file using the exec/system function

[PHP]exec("c:/winzip32 -e -sPassword TheFile.zip folderInZipFileToExtract) [/PHP]

That above line of code extracts the entire zip file. And it does so either before php loads the file or after -- I want it to extract the content when it loads the file… (Because when php loads the file it will return a nice tidally little error message proudly stating that permission is denied to the file).

All I want is that when php hits the password protected file it will enter it nicely and continue streaming.

Please please, pretty please sugar on the top of a hill cake of… eh—more sugar. Sprinkled with sweet sweet sugar. I have been googling-goggling for a very long time. Please please help me.
Nov 25 '07 #1
2 2232
I have found the following functions of interest:

passthru
popen
proc_open

But I fail to see how they can help me.

Just to summarize:

I need to combine
[PHP]fopen('zip://file.zip#folder/file');[/PHP]
with
[PHP]system("c:/winzip -e -sPassword pathToZipFile extractTo");[/PHP]
So that it will stream a zip file that is password protected.
Nov 26 '07 #2
Notes for future self.

I found something interesting, opening the encrypted file

[PHP]fopen('zip://file.zip#folder/file');[/PHP]

will result in a garbage string. I'm guessing that winzip encrypts each file ("Encryption applies only to the contents of files stored within a Zip file."), and then stores them. In other words, that "garbage" string should be useful, that is if it could be decrypted.

see

AES Encryption Information: Encryption Specification AE-1 and AE-2

and

AES Coding Tips for Developers

I'm guessing that if you can get hold of the relevant variables you could decrypt the content "manually" with PHP. But, then again, I'm way over my head now.

Giving that there is zero interest for this thread, I'm officially giving up.

.. Oh well. Back to school...
Nov 26 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Wm | last post by:
Something just occurred to me... <yeah, I know, it scared me too> I just password-protected a website by including a password authentication script in each page of a private section. The script...
6
by: natshaw99 | last post by:
I'm looking for a ready package or shareware that will let visitors to my site download individual files after I mail them the password. I'm not looking to encrypt the files and don't care if the...
9
by: John Kirksey | last post by:
I have a page that uses an in-place editable DataGrid that supports sorting and paging. EnableViewState is turned ON. At the top of the page are several search fields that allow the user to filter...
2
by: Sam | last post by:
I have a custom control (MyTextBox - taken from Microsoft website) that implements the IPostBackDataHandler interface. It is added to the controls collection of a placeholder control during the...
1
by: Reza Nabi | last post by:
Bakground: I have a webform (LoadCtl.aspx) which loads the user control to a placeholder dynamically based on the ctlName querystring passed in the URL. Webform (LoadCtl.aspx) also passes a...
2
by: Sascha | last post by:
Hi there, I searched carefully through the web before finally deciding to post this message, because I could not find a solution for my problem. Hopefully someone will have a hint or explanation...
6
by: hitendra15 | last post by:
Hi I have created web user control which has Repeater control and Linkbutton in ItemTemplate of repeater control, following is the code for this control On first load it runs fine but when...
5
by: nick | last post by:
I need to create a simple asp.net application that use password protect some html pages. The html page provider doesn't know asp.net. And the host doesn't allow me to create user accounts. ...
4
by: prophet | last post by:
so hopefully only one more question about this..... so I have a webpage using frames. I have a header and a column down the left, and the main body (all of which have different htmls but are...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.