Use Drupal Form API to Upload File

How to upload images in drupal 6 form API?

Check the following article will help you easily go through:

Following are some drupal file form validate function

Namesort descending Type Location Description
file_validate_extensions function includes/file.inc Check that the filename ends with an allowed extension. This check is not enforced for the user #1.
file_validate_image_resolution function includes/file.inc If the file is an image verify that its dimensions are within the specified maximum and minimum dimensions. Non-image files will be ignored.
file_validate_is_image function includes/file.inc Check that the file is recognized byimage_get_info() as an image.
file_validate_name_length function includes/file.inc Check for files with names longer than we can store in the database.
file_validate_size function includes/file.inc Check that the file’s size is below certain limits. This check is not enforced for the user #1.

How to theme a form in Drupal6 with Drupal Form API

Drupal provide a Form API to let us make a form. That is a right way to do that.

By default, it create a form element in html like this:

But how to add some custom html or class into it? Continue reading How to theme a form in Drupal6 with Drupal Form API