Pictures not copying


I have been trying everything to get this to work. Here is the delimma:
I have two folders, one called temp pics, and one called premenant pictures. The first folder holds pictures people submit; this works fine. I am scripting with php. I am using 755 by the way, cause I know that is sometimes the problem. The script creates a folder and then places the file in that folder. Later the file needs to be copied, but it says it doesn’t exist! here is the code:

mkdir($_SERVER[‘DOCUMENT_ROOT’] . ‘/pics/profiles/’ . $_POST[‘userid’], 0755);

copy($_SERVER[‘DOCUMENT_ROOT’] . ‘/pics/pending/’ . $_POST[‘userid’] . ‘/’ . $strPicName . ‘’,
$_SERVER[‘DOCUMENT_ROOT’] . ‘/pics/profiles/’ . $_POST[‘userid’] . ‘/’ . $strPicName . ‘’);

unlink($_SERVER[‘DOCUMENT_ROOT’] . ‘/pics/pending/’ . $_POST[‘userid’] . ‘/’ . $strPicName . ‘’);

I get this error:
Warning: copy(/home/(myname)/(mywebsite)/pics/pending/71/A big glass of kitty.jpg>): failed to open stream: No such file or directory in /home/.padrino/thecheat/ on line 165

Warning: unlink(/home/(myname)/(mywebsite)/pics/pending/71/A big glass of kitty.jpg>): No such file or directory in /home/.padrino/home/(myname)/(my website)/security/registration.pcgi on line 170

what’s the problem? they exist!


little help? heh
any ideas?


Not familiar with the program, but I’d check the paths again.

You could try removing “.padrino” from the paths.
Ex: /home/.padrino/thecheat to /home/thecheat

Your other error shows ‘home’ mentioned twice in the path. /home/.padrino/home – so you might want to look into that.


instead of $_SERVER[‘DOCUMENT_ROOT’]

put in the actual doc root

/home/.padrino/home/(myname)/(my website)/security/ - somethng like that with the .padrino

I have problems with php’s file functions for delting and moving files when i never had the .cabowasher in my path…

Really annying since the path can change. mine changed from .cabo to .cabowasher and caused quite a few scripts to stop working.


I’ll be darned. I’ve never had a script not work without the .whatever in the path and quite a few fixed by eliminating it. To me it seems the more automated path discovery and configuration an install script does, the more likely it is to have this problem. In particular, the conflict between paths I hand enter (which never include .whatever) vs detected paths, which often do. Sometimes I have to dig into a config file not directly accessible from a control panel to get at and edit out .whatever.


okay well I have tried everything then, I tried using
copy(‘home/.padrino/home/thecheat/’ . $_POST[‘userid’] . ‘/’ . $strPicName,
‘home/.padrino/home/thecheat/’ . $_POST[‘userid’] . ‘/’ . $strPicName);

and the same thing with a /home at the beginning. I don’t know if this is what you meant… where can I get to the congif file to change this, haggis? I wish I could get this problem resolved!




the .padrino bit is variable, always leave it out or the script will break when it changes to .padinowhateverhideousblender or somesuch



if it’s php try running the script as pcgi rather than the standard php.


well I just tried it without the .padrino bit and no luck. and I already have it as .pcgi cause I couldn’t get the pictures to copy from the user earlier, and that solved THAT problem, but not this one.