I'm using upload script, but after upload files are 600 instead 644, I tried put somewhere this bit of code: $chmod = chmod($path, 0766); //set the appropriate permissions. PHP: but i'm not sure where exactly it should be in this part of script's code pasted below: <?php /** * Menu-callback for JavaScript-based uploads. */ function yui_editor_image_upload() { header("content-type: text/html"); // the return type must be text/html $response = null; $path = file_directory_path(); //Append trailing slash to path if not there if (! (substr($path, -1) == '/')) { $path .= '/'; } $path .= 'images'; $file = file_save_upload('upload', array(), $path, FILE_EXISTS_REPLACE); if (!$file) { $response->status = 'Error Reading Uploaded File.'; print drupal_to_js($response); exit; } $response->status = 'UPLOADED'; $response->image_url = $file->filepath; print drupal_to_js($response); exit; } ?> PHP:
<?php /** * Menu-callback for JavaScript-based uploads. */ function yui_editor_image_upload() { header("content-type: text/html"); // the return type must be text/html $response = null; $path = file_directory_path(); //Append trailing slash to path if not there if (! (substr($path, -1) == '/')) { $path .= '/'; } $path .= 'images'; $file = file_save_upload('upload', array(), $path, FILE_EXISTS_REPLACE); if (!$file) { $response->status = 'Error Reading Uploaded File.'; print drupal_to_js($response); exit; } else $chmod = chmod($file->filepath, 0766); //set the appropriate permissions. $response->status = 'UPLOADED'; $response->image_url = $file->filepath; print drupal_to_js($response); exit; } ?> Code (markup): $path will only change the directory chmod from the looks of it, so I changed it to $file->filepath