Re: is_file returns false - while the file exists

2013-02-22 Thread Evan Jenkins
Thanks! I used a slight different version where I first set a variable containing the file location info as follows: > Thank you! > if(file_exists(IMAGES_DIR. 'upload' . DS . 'filename')) worked for > me. > Thank you once again:-)) > > -- Like Us on FaceBook https://www.facebook.com/CakePHP

Re: is_file returns false - while the file exists

2007-09-05 Thread Anna P
Thank you! if(file_exists(IMAGES_DIR. 'upload' . DS . 'filename')) worked for me. Thank you once again:-)) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake

Re: is_file returns false - while the file exists

2007-09-04 Thread AD7six
On Sep 4, 5:33 pm, Anna P <[EMAIL PROTECTED]> wrote: > OK so how to use it? When I try > if(is_file("../img/upload/photo_file1_".$item['Item'] > ['id'].".jpg")): (the path, which just gives me the right > image) > it doesn't work as well. Hi, 2 tips: 1) You need an absolute path to the fil

Re: is_file returns false - while the file exists

2007-09-04 Thread Baz
I know I'm not helping with the issue at hand, but I got a suggestion: I do something similar. Since you seem to control your filename (not a user uploaded file) then you could just set a boolean field on your controller: image. Then your "if" will just deal with your controller. I was just think

Re: is_file returns false - while the file exists

2007-09-04 Thread francky06l
if(file_exists(IMAGES. 'upload' . DS . 'filename')) hope this helps On Sep 4, 8:31 pm, Ketan Patel <[EMAIL PROTECTED]> wrote: > look in cake/config/paths.php, it has most of the general path > constants that one would need. I think WEBROOT_DIR is what you need, > however, look in that file for m

Re: is_file returns false - while the file exists

2007-09-04 Thread Ketan Patel
look in cake/config/paths.php, it has most of the general path constants that one would need. I think WEBROOT_DIR is what you need, however, look in that file for more info. Ketan Anna P wrote: > OK so how to use it? When I try > if(is_file("../img/upload/photo_file1_".$item['Item'] > ['id'].".j

Re: is_file returns false - while the file exists

2007-09-04 Thread Chris Hartjes
On 9/4/07, Anna P <[EMAIL PROTECTED]> wrote: > > OK so how to use it? When I try > if(is_file("../img/upload/photo_file1_".$item['Item'] > ['id'].".jpg")): (the path, which just gives me the right > image) > it doesn't work as well. > I think you will have to experiment with figuring out what

Re: is_file returns false - while the file exists

2007-09-04 Thread Anna P
OK so how to use it? When I try if(is_file("../img/upload/photo_file1_".$item['Item'] ['id'].".jpg")): (the path, which just gives me the right image) it doesn't work as well. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goo

Re: is_file returns false - while the file exists

2007-09-04 Thread Ketan Patel
There is a problem with this statement. >>if(is_file($this->webroot."img/upload/photo_file1_".$item['Item']['id'].".jpg")): Chris is right, Above statement gives you the path readable by browser not the filesystem bcoz of '$this->webroot.' Ketan Anna P wrote: > Hi. I have problem with web photo

Re: is_file returns false - while the file exists

2007-09-04 Thread Chris Hartjes
On 9/4/07, Anna P <[EMAIL PROTECTED]> wrote: > > Hi. I have problem with web photo gallery for a store. > Photos are uploaded by CMS. They are stored in webroot/img/upload and > their name is like "photo_file1_{item_id}", "photo_file2_{item_id}", > etc. > > The problem is when I try to display pho

is_file returns false - while the file exists

2007-09-04 Thread Anna P
Hi. I have problem with web photo gallery for a store. Photos are uploaded by CMS. They are stored in webroot/img/upload and their name is like "photo_file1_{item_id}", "photo_file2_{item_id}", etc. The problem is when I try to display photos and first I want to check if the item of the store has