AO creating mkdir folder via PHP is not accessible via FTP

0

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');
    
asked by anonymous 01.10.2017 / 18:41

1 answer

0

You are creating the folder with mkdir on a linux server, probably the permissions are locked.

Create the folder with ftp_mkdir, so you can define the user that can open, and use it to access with some client such as filezila:

$dir = 'pasta';
$conn = ftp_connect('ft.seuhost.com');
$rs = ftp_login($conn, 'usuario_ftp', 'senha_do_usuario');
if (ftp_mkdir($conn, $dir)) {
    //ok
} else {
   //Erro
}
ftp_close($conn);
    
02.10.2017 / 14:26