Tel: 91-98574-11333 | Mail: inderweb.com@gmail.com


enctype

File Save Upload for Drupal 6 users Accessing $_FILES is not prefered in drupal

In drupal 6 you can use file_save_upload() function for saving your uploaded files.Instead of mannually accessing $_FILES drupal standard is prefered.

<?php
file_save_upload
($source, $validators = array(), $dest = FALSE, $replace = FILE_EXISTS_RENAME);
?>

For making your custom form to work for file upload you need to set Enctype for your form in following manner:-

<?php
$form
['#attributes'] = array('enctype' => "multipart/form-data");
?>