error:
Warning: rename(/plugins/jQuery-File-Upload-master/server/php/files/quote_new.jpg,
/content/register/profile_pics/12_quote_new.jpg): No such file or directory in …
You can also use the full path to the file itself. Generally, I don’t find $_SERVER['DOCUMENT_ROOT'] and dirname(__DIR__) very helpful because they don’t give an exact path. Say you are creating an installation folder and the root folder of the installation can change and vary depending on what the client wants it to be. That being said $_SERVER['DOCUMENT_ROOT'] won’t necessarily help because it only outputs the root directory up until your root folder stops. Where your domain folder beings is where it stops. So you would have to manually write in the directory you want. And that shouldn’t be the case because you want the file path to be dynamic and exact. So I propose using this
realpath(__DIR__)
I use it all the time because it gives you an exact path that the current file is in. All you need to do is then either strip out the current file name or go a directory level below.