I am on an Apache / 2.2.22 (Debian) server, and when creating a folder to upload an image for example the folder is totally inaccessible via FTP. You can not delete or even enter the folder.
$folder_name = 'pasta/date/arquivos/';
mkdir($folder_name, 0775, true);
copy('http://exeplo/img.jpg', $folder_name.'img_name.jpg');