Examples: File Examples

The File Example module is a part of the Examples for Developers Project and provides various Drupal File API Examples. You can download and experiment with this code at the Examples for Developers project page.

See Drupal File API for handbook documentation on the File API and File summary on api.drupal.org for the function summary.

Functions & methods

NameDescription
file_example_create_directory_submitSubmit handler for directory creation. Here we create a directory and set proper permissions on it using file_prepare_directory().
file_example_delete_directory_submitSubmit handler for directory deletion.
file_example_managed_write_submitSubmit handler to write a managed file.
file_example_readwriteForm builder function for the file example readwrite and directory creation example.
file_example_read_submitSubmit handler for reading a stream wrapper.

examples/file_example/file_example.module, line 10