K
K
kolibry12015-02-23 16:51:09
PHP
kolibry1, 2015-02-23 16:51:09

Why is access denied on the local server?

Good afternoon.
on my local server (apache, mac os) for some reason I can't upload the file to the server through the form, they write that access is denied,

Warning: copy(/Users/kolibry/sites/zagruz4ik/inbox/1.jpg): failed to open stream: Permission denied in /Users/kolibry/sites/zagruz4ik/my_csv.php on line 14

$uploaddir = '/Users/kolibry/sites/zagruz4ik/inbox/';
$uploadfile = $uploaddir.basename($_FILES['csvfile']['name']);
if (copy($_FILES['csvfile']['tmp_name'], $uploadfile)) /*14строка*/
{
echo "<h3> ну наконец-то :)</h3>";
}

why can that be? to the file in which this form is written, made in the properties "writing and reading", in theory everything should work with this?
ps in Google it says a little about "put down the rights 777" - a kind request, if you think that this is the right decision and will help - please specify where and where it is prescribed. Thanks.)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Saboteur, 2015-02-23
@kolibry1

The directory must have write and execute permissions, the file (if any) must have write permissions.
And don't forget to specify under what name the web service is running, because the form will try to write on its behalf.

N
Nastya Sukharik, 2015-02-23
@nastya_cyxarik

If I'm not mistaken, the rights should be 755 and check the rights of the file.
https://developer.apple.com/library/mac/documentat...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question