The other answers explainsprovides a good explanation of what it should be done, I only want to add a script to fix the permissions if you already uploaded a component and can't access the files with ftp.
In this case I would upload this file as fix.phpfix.php
to the ftpFTP server and open it in the browser: http://example.com/fix.phphttp://example.com/fix.php
<?php
file_fix_directory(dirname(__FILE__));
function file_fix_directory($dir, $nomask = array('.', '..')) {
if (is_dir($dir)) {
// Try to make each directory world writable.
if (@chmod($dir, 0777)) {
echo "<p>Made writable: " . $dir . "</p>";
}
}
if (is_dir($dir) && $handle = opendir($dir)) {
while (false !== ($file = readdir($handle))) {
if (!in_array($file, $nomask) && $file[0] != '.') {
if (is_dir("$dir/$file")) {
// Recurse into subdirectories
file_fix_directory("$dir/$file", $nomask);
}
else {
$filename = "$dir/$file";
// Try to make each file world writable.
if (@chmod($filename, 0666)) {
echo "<p>Made writable: " . $filename . "</p>";
}
}
}
}
closedir($handle);
}
}
This script sets all filesthe file's permissions to 666 and all directoriesdirectory's to 777. World write able, thats notwritable is not the best set of permissions for a shared host but you canwill be able to access your files again and maycan then set it correctlyto the correct values with ftpFTP.