<how to use FTP drupal_ftp
anka - April 17, 2008 - 08:28
Hi,
I wrote you from France and my english it's not very good, so excuse me for the mistakes about grammary.
I use the module ftp drupal and I have some problems to use it. I understood that it's just an engine. There'is no upload form by default; I added an upload form, the file is not really transfered; drupal ftp create only one empty file on the server.
I want to know how to use this module to upload a file in the server ?
Has somebody used this module to upload files; please I need some help!
I have this code for the submission of the form:
<?php
function drupal_ftp_transfer_file_submit($form, $form_values) {
$dir = $form_values['directory'];
$home = variable_get('drupal_ftp_default_home_directory', DRUPAL_FTP_DEFAULT_HOME_DIRECTORY);
$file = $form_values['fichier'];
drupal_set_message('<pre>'. print_r($file, TRUE) .'</pre>');
if (drupal_ftp_file_to_ftp($file, $ftp_filename, $home, &$ftp)) {
drupal_set_message(t('File transfered.'));
}else{
drupal_set_message(t('File no transfered.'));
}
return 'ftp/browse' . $dir;
}
?>Merci beaucoup pour vos réponses
