Take care of basePath for upload url

If there is a specific root path defined for the website, we need to add it to access to the web resources.

Example:
http://localhost/index.php            getBasePath() returns an empty string
http://localhost/index.php/page       getBasePath() returns an empty string
http://localhost/mywebsite/index.php  getBasePath() returns '/mywebsite'