ballouta Posted June 13, 2008 Share Posted June 13, 2008 Hello I have a function that decompresses a Zip file. It is working properly when I am writing the zip file name without any previous path before. e.g.: file.zip When editing the path to: $archive = new PclZip('/home/sitename/public_html/stk/$user/$myf'); or $archive = new PclZip(/stk/$user/$myf'); The functions says that the file is missing. Note that both the 'stk' and '$user' directory already exisit. Why it is NOT detecting the file name? Quote Link to comment Share on other sites More sharing options...
zenag Posted June 13, 2008 Share Posted June 13, 2008 show ur class file Quote Link to comment Share on other sites More sharing options...
Kurrel Posted June 13, 2008 Share Posted June 13, 2008 Also, try this to get a listing of the files in the directory base. You may find that the program is referencing a different directory base to the one you're expecting. if ($handle = opendir("../")) { while (false !== ($file = readdir($handle))) { print($file."<br>"); } closedir($handle); } Quote Link to comment Share on other sites More sharing options...
ballouta Posted June 13, 2008 Author Share Posted June 13, 2008 the Library File is very long (aroung 5000 lines!) but the function is this one: function PclZip($p_zipname) { //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::PclZip', "zipname=$p_zipname"); // ----- Tests the zlib if (!function_exists('gzopen')) { //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 1, "zlib extension seems to be missing"); die('Abort '.basename(__FILE__).' : Missing zlib extensions'); } // ----- Set the attributes $this->zipname = $p_zipname; $this->zip_fd = 0; $this->magic_quotes_status = -1; // ----- Return //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 1); return; } When I write the zip file for it as is, and it is in the same location of this code, it works properly and uncompresses the zip file. Please make sure that I do NOT have problem in my path syntax or concept. thanks Quote Link to comment Share on other sites More sharing options...
zenag Posted June 13, 2008 Share Posted June 13, 2008 make sure that " $user/$myf " values are displayed properly & try to echo $p_zipname & check if it displays correct path Quote Link to comment Share on other sites More sharing options...
bobinindia Posted June 13, 2008 Share Posted June 13, 2008 does the new folder have write permission? Quote Link to comment Share on other sites More sharing options...
ballouta Posted June 13, 2008 Author Share Posted June 13, 2008 I echo both varaiabled $user & $myf and they are correct. $user printed for me the correct user loged in and $myf printed the zip file name. The problem is that the code is giving this error: Missing archive file '/stk/$user/$myf' stk is an exisitng directory, $user is also a new directory created before uncompressing the code, and i can see it. where's the problem now? and if the folder permissions are uncorrect how do I fix it? thanks Quote Link to comment Share on other sites More sharing options...
ballouta Posted June 13, 2008 Author Share Posted June 13, 2008 It is working now thanks for you all I just replaced the single quotation with double quotation and it worked Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.