*************** *** 914,919 **** return FALSE; } // If we made it this far it's safe to record this file in the database. if ($file = file_save($file)) { // Add file to the cache. --- 913,923 ---- return FALSE; } + // By default, give everyone read access so that FTP'd users or + // non-webserver users can see/read these files, and give group write + // permissions so group members can alter files uploaded by the webserver. + @chmod($file->filepath, variable_get('file_chmod_file', 0664)); + // If we made it this far it's safe to record this file in the database. if ($file = file_save($file)) { // Add file to the cache.