ID: 14631
User updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: Filesystem function related
Operating System: Linux
PHP Version: 4.0.5
New Comment:

A "PHP GURU" friend of mine finally found out a solution : 
I think I should share it with you : 
instead of 
if (is_file("upload/".$ZeFiles->file_name)){...  

You have to give the absolute (server-related) path to the file [PATH_TRANSLATED]: 

if (is_file("/home/circusp/am17204/upload/.. and so on..


Still, that doesn't account for the bug, as it works on the other file. That is just a 
"workaround" then. 

Hope this helps



Previous Comments:
------------------------------------------------------------------------

[2001-12-20 14:38:37] [EMAIL PROTECTED]

Hi gurus and Fellows.

I've been through the Bug Database but didn't find out a related bug.  

I use a function that is common to two different pages.
(see code Below). These two pages are located in the same directory on my
website.

For a given reason , (which I would like to know), the function is not
working any longer (but it USED to) on one of this page.
Actually I can point out where (what) it is not working :
->  if (is_file("upload/".$ZeFiles->file_name)){  ...
In one PHP page it says OK it is a file (and yes it is, if I type the address directly 
in the address bar) on the other page, it
says the opposite!!

If I take this condition off this condition it displays : 

Warning: Unable to open upload/1_o_alum_off.gif  
where "1_o_alum_off.gif" is the name of the (existing) picture...

The consequence being, I just cannot used the GetImageSize() function to retrieve the 
picture dimensions...

Any idea anyone ?


ThanX.



olivier aKa Cypher.


//___________________________________________

function listFilesFromDB($Ze_mydir, $connexion)
{//extract FileName from DB , gets its size and generate the
//Javascript code for a fitted "Pop Up" window.
 $appendIt="";
 $resultat = ExecRequete ("select * from Files where us_id=".$Ze_mydir,
$connexion);

   if (mysql_num_rows($resultat)) {

    while ($ZeFiles = LigneSuivante ($resultat))
    {
   if (!eregi(".mp3",$ZeFiles->file_name)){
      if (is_file("upload/".$ZeFiles->file_name)){   //just in case...//that's where 
the problem lies...
    $imagehw = GetImageSize("upload/".$ZeFiles->file_name); //let's create
PopUp to the Picture Dimensions...
    $imagewidth = $imagehw[0]+60;        //let's add an extra margin...
    $imageheight = $imagehw[1]+75;
    $zePopUpScript = "\n<a href=\"javascript:
window.open('showPortFolio.php?idFile=".$ZeFiles->file_id."','','resizable=y
es, scrollbars=yes, width=".$imagewidth .",height=".$imageheight."');
void('');\">";
    $appendIt.=
"<TR><TD>$ZeFiles->file_title</TD><TD>".$zePopUpScript."View</a></TD><TD><a
href=\"#\"
onClick=\"javascript:ConfDel(".$Ze_mydir.",".$ZeFiles->file_id.");\">Delete<
/a></TD></TR>\n";
    }
   }
   else {// it is a mp3  file : no need for PopUp...A link should do...
   $zePopUpScript = "link to Mp3 file ".$ZeFiles->file_name;
   $appendIt.=
"<TR><TD>$ZeFiles->file_title</TD><TD>".$zePopUpScript."View</a></TD><TD><a
href=\"?action=delete&file_id=".$ZeFiles->file_id."&id=".$Ze_mydir."\">Delet
e</a></TD></TR>\n";

   }
  }
  echo "<center>\n<table width=360><tr><td colspan=3><h1>-------------Your
Files-------------</h1></td></tr>\n$appendIt\n</table>\n</center>";

   }else{
  echo "<center>\n<h1>No Files so far</h1>\n</center>";
   }

}


// calling the function :
  listFilesFromDB($id,$connexion);

//___________________________________________


PS : Code for both page available upon Request.
PHPinfo : 
http://nfrance.com/~am17204/pont/brouillon/test.php


------------------------------------------------------------------------



Edit this bug report at http://bugs.php.net/?id=14631&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to