Hello,

I have a script that needs to unzip a .zip file into a temp folder. The problem is that it's very difficult to ask the user to create their own temp folder after uploading the script, give it 777 permissions, and then we run into problems if they are running safe_mode, etc. (Because the unzipper can only create one level of folders under the 777 folder before it runs into permissions problems to create additional folder levels...)

I know there is a way to create a temp FILE... but...

... is there any way to create a FOLDER in the temp area for php? And then I could simply unzip the file into that temp folder and kill it when the script is done?

Is it reliable? ie: It has to work on every server, including php4, php5, unix, linux, and windows...

Thanks for any advice!

    FatalError wrote:

    mkdir()

    Thanks, but that wasn't very helpful. I know where php.net is located. Giving me instructions to RTFM, when I asked a very specific question and explained why my current method is not working...

    I will explain further.

    I am actually doing a temp folder creation right already... but it doesn't work for some php safe_mode servers.

    My script currently creates a folder (using ftp so it's "owned" by the right user) with permissions of 777. Then it tries to unzip the file into that temp folder...

    .. but it fails because the safe_mode restriction means that only ONE level of folders can be created by the "nobody" user, even if the parent folder that's owned by the real user has permissions of 777.

    Thus.. I'm simply trying to figure out a way to unzip a file that has many levels of folders.. on a safe mode server.

    Any ideas?

      Write a Reply...