/    Sign up×
Community /Pin to ProfileBookmark

problem in uploading files in ftp

hi,
I am uploading files in localhost its working but i am trying to upload files to ftp but that time it shows some warning error

Warning: move_uploaded_file(resumes/ftp details.txt) [function.move-uploaded-file]: failed to open stream: Permission denied in /home/earthlin/public_html/careers.php on line 28

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move ‘/tmp/phpIyZ241’ to ‘resumes/ftp details.txt’ in /home/earthlin/public_html/careers.php on line 28

can anyone help me

Thanks in advance
[code>]
<?PHP
$image_name = $_FILES[‘txtattach’][‘name’];

$target_path = “resumes/”;
$target_path1 = $target_path.$image_name;

if(is_uploaded_file($_FILES[‘txtattach’][‘tmp_name’]))
{
$userfile_type = $_FILES[‘txtattach’][‘type’];

if (move_uploaded_file($_FILES[‘txtattach’][‘tmp_name’], $target_path1)) {
echo “File uploaded successfully.”;
} else {
switch($_FILES[‘txtattach’][‘error’]) {
case 1 : echo “1The uploaded file exceeds the upload_max_filesize directive in php.ini.”;
break;
case 2 : echo “1The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.”;
break;
case 3 : echo “1The uploaded file was only partially uploaded.”;
break;
case 4 : echo “1No file was uploaded.”;
break;
case 6 : echo “1Missing a temporary folder.”;
break;
case 7 : echo “1Failed to write file to disk”;
break;
case 8 : echo “File upload stopped by extension”;
break;
}
}
}

?>
[/code]

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@chazzyJan 31.2009 — you need to give permissions to the user apache runs as to read/write those directories.
×

Success!

Help @punithapary 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.19,
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,
)...