[HELP ME] Tiny PHP problem is "ruining my life"!

Is the the temp file there (/tmp/phpQOE2AK)? Try setting the absolute path of your data folder and see what happens.
PHP:
move_uploaded_file($NEWFILE,"./data/$curmember[mid]/$NEWFILE_name");
to
PHP:
move_uploaded_file($NEWFILE,"/absolute/path/to/data/$curmember[mid]/$NEWFILE_name");
 
Whooops, double post, sorry. Read below:
 
Last edited:
Is the the temp file there (/tmp/phpQOE2AK)? Try setting the absolute path of your data folder and see what happens.
PHP:
move_uploaded_file($NEWFILE,"./data/$curmember[mid]/$NEWFILE_name");
to
PHP:
move_uploaded_file($NEWFILE,"/absolute/path/to/data/$curmember[mid]/$NEWFILE_name");

Grizzy, what do you exactly mean under "absolute path"? According to my error message would it be:

Code:
/chroot/home/visszasz/joyridercoaching.com/html/data/$curmember[mid]/$NEWFILE_name
?
 
Well, obviously you were thinking about something else, because I tried the path above, and it still doesn't work... :S
 
Made fast internet search, saw an example of absolute path.

"chroot/" deleted, starts with "/home..."

Still doesn't work, same error message, but with this longer "seemed-to-be-absolute-path" in the first line instead of "./data..."
 
Ok. New search for absolutepath.

Got a code:

PHP:
<?php echo $_SERVER['DOCUMENT_ROOT']; ?>

Saved a s absolutepath.php, uploaded to root, loaded with firefox, it shows my absolute path:

Code:
/home/visszasz/joyridercoaching.com/html

Okay, modified my script:
PHP:
move_uploaded_file($NEWFILE,"/home/visszasz/joyridercoaching.com/html/data/$curmember[mid]/$NEWFILE_name");

AND FREAKIN' ERROR COMES :banghead:

PHP:
Warning: move_uploaded_file(/home/visszasz/joyridercoaching.com/html/data/19/) [function.move-uploaded-file]: failed to open stream: Is a directory in /chroot/home/visszasz/joyridercoaching.com/html/incs/front/inc/uploadedit.inc.php on line 45

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpqZeu4z' to '/home/visszasz/joyridercoaching.com/html/data/19/' in /chroot/home/visszasz/joyridercoaching.com/html/incs/front/inc/uploadedit.inc.php on line 45

I really dunno what the heck shall I try, and this tiny littl' sh*t delays my work... :(
 
Sorry man, I can't do much debugging from here. But that error means that the move_uploaded_file() function is expecting one of its parameters to be a path to a file and it's finding a directory there instead. It's got to be some sort of error realted to the path. I guess it could be permission related, but I would think the error would be different.. :confused:
 
Sorry man, I can't do much debugging from here. But that error means that the move_uploaded_file() function is expecting one of its parameters to be a path to a file and it's finding a directory there instead. It's got to be some sort of error realted to the path. I guess it could be permission related, but I would think the error would be different.. :confused:

Okay, at least you tried your best to help, I do very appreciate it. Now I continue to search for the root of the problem.

Again: thanks for your valuable time, Grizzy!
 
Your welcome drnobrain :). I'm sure a much more knowledgeable php coder will come along soon with some advice. Good luck!
 
Clearly its a path issue from what i can get of this limited info over here..this should solve the issue

PHP:
<?PHP
$tmpfile = tempnam("dummy","");
$path = dirname($tmpfile);
echo $path;
unlink($tmpfile);
?>

upload this file to your server this will give the path to temporary directory

now store that value in a variable and append the path to the temporary file name..
Thats should solve it
 
Clearly its a path issue from what i can get of this limited info over here..this should solve the issue

PHP:
<?PHP
$tmpfile = tempnam("dummy","");
$path = dirname($tmpfile);
echo $path;
unlink($tmpfile);
?>

upload this file to your server this will give the path to temporary directory

now store that value in a variable and append the path to the temporary file name..
Thats should solve it

Thanks for caring about me, but as I mentioned in my first post in this thread, I'm an (aaaaalmost) TOTAL IDIOT to PHP.

So the things that you suggested are "completely Chinese" to me. :) :(

I don't know how exactly apply this value to the script I attached to thread starter. What I understood is to make a php file containing this code you provided.

Okay, made a temp.php, uploaded to root, and that's it. I don't know what to do next. :(
 
Back
Top