4
Contributors
16
Replies
53
Views
4 Years
Discussion Span
Last Post by paulkd
Featured Replies
  • 1

    Are you sure you are referring to the right path? The slash before user directs it to the root of your server. Perhaps it should be `./user/`, which finds the user folder in the current directory. Read More

  • 1

    > not working Please read this forum's [read-me](http://www.daniweb.com/web-development/php/threads/435023/read-this-before-posting-a-question) and you'll understand why that comment is completely worthless to us. Read More

1

Are you sure you are referring to the right path? The slash before user directs it to the root of your server. Perhaps it should be ./user/, which finds the user folder in the current directory.

0

Your related thread stated this at the end...

i solve it with dirname(__FILE__)

Which I thought was overkill, as './'by pritaeas pretty much sets the location relative to the current directory.

Edited by diafol

0

i'm not sure will work because the code is in a included file through many levels

0

You could always do an absolute...

$dir = $_SERVER['DOCUMENT_ROOT'];
$dir .= '/subdirectory1/subsubdirectory7/';

This assumes that you haven't stored the upload directory above the document root. This is a bit of a fudge though.

Setting constants like UPLOAD_PATH like these in your top include file (e.g. config.php file) can often obviate these types of problems.

Edited by diafol

0

i get "open_basedir restriction in effect. File(/usr/local/apache/htdocs/user/name_of _user/avatar.jpg) is not within the allowed path(s)"

Edited by andreiviziru

0

yes but there it tells me to modify apache configurations and restart it. I cant do that on my host

0

Where on your website is the actual file stored?

e.g. http: //www.mywebsite.com/assets/images/avatar.jpg

Edited by paulkd: don't want the example url to be an anchor

0

i have somekind of control panel

I think it might be best if you raised a support ticket with your host.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.