/    Sign up×
Community /Pin to ProfileBookmark

failed to open stream: Permission denied in on line 16

i am using windows

[code]<?php

if (isset($_POST[‘submit’])){

$company_name = $_POST[‘company_name’];

$company_image = $_FILES[‘image’][‘name’];
$company_image_temp = $_FILES[‘image’][‘tmp_name’];

$company_content = $_POST[‘company_content’];
$company_tags = $_POST[‘company_tags’];
$company_comment_count = 4;

move_uploaded_file( $company_image_temp,”../images/$company_image “);
[/code]

10 and i am trying to upload image in images `folder“

__(Added `[code]…[/code]` tags ~ MOD)__

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@NachfolgerApr 17.2020 — > @passy#1617535 move_uploaded_file( $company_image_temp,"../images/$company_image ");

This is probably line 16, and PHP outputs quite easily interpretable errors. "Permission denied", aka, your folder settings aren't correct. Make sure www-data is the folder owner.
Copy linkTweet thisAlerts:
@NogDogApr 17.2020 — In case it's not clear, the script actually gets run by the web-server user (might be "apache", "nobody", etc.), not by your personal login account on the server; so you need to make sure that user has write permission on the target directory.
Copy linkTweet thisAlerts:
@passyauthorApr 18.2020 — @Nachfolger#1617537 how do i make www-data the folder owner
Copy linkTweet thisAlerts:
@NachfolgerApr 18.2020 — @passy#1617544 what operating system is the server running?
×

Success!

Help @passy spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.7,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...