Reputation: 23
Well my PHP script generated an error with a hyperlink in it.
Does anyone know what's wrong?
PHP Warning: rename(./uploads/temp/00013/,./uploads/orders/39/) [<a href='function.rename'>function.rename</a>]: No such file or directory
update:
actual code in PHP
if(!file_exists('uploads/orders/')) { mkdir('uploads/orders/'); // ensuring the orders folder exist } rename('uploads/temp/' . $u . '/', 'uploads/orders/' . $i . '/');
update:
Sorry, my fault. I coded to delete previous temp folder before this code execute. Thanks!
Upvotes: 2
Views: 4042
Reputation: 111249
When a computer tells you
No such file or directory
the first thing you should check is if the file/directory exists. This is not a random error message, it's given only in the specific situation when a file or directory you try to use does not exist.
In this case in particular, both ./uploads/temp/00013/
and ./uploads/orders/
have to exist. If orders
doesn't exist it's not created for you.
Upvotes: 1
Reputation: 4439
It seems that one (or both) of these directories don't exist:
Have you checked that:
Upvotes: 2