README.txt 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. This module integrates the Plupload library (available from http://plupload.com)
  2. with Drupal forms. To install the Plupload library:
  3. 1. Download it (version 1.5.1.1 or later) from http://plupload.com.
  4. 2. Unzip it into sites/all/libraries, so that there's a
  5. sites/all/libraries/plupload/js/plupload.full.js file, in addition to the
  6. other files included in the library.
  7. 3. Remove "examples" folder from libraries folder as it could constitute a
  8. security risk to your site. See http://drupal.org/node/1895328 and
  9. http://drupal.org/node/1189632 for more info.
  10. If you would like to use an alternate library location, you can install the
  11. http://drupal.org/project/libraries module and/or add
  12. $conf['plupload_library_path'] = PATH/TO/PLUPLOAD;
  13. to your settings.php file.
  14. At this time, this module only provides a 'plupload' form element type that
  15. other modules can use for providing multiple file upload capability to their
  16. forms. It does not provide any end-user functionality on its own. This may
  17. change, however, as this module evolves. See http://drupal.org/node/880300.
  18. ---=== For developers ===---
  19. Plupload from element can be used like this:
  20. $form['my_element'] = array(
  21. '#type' => 'plupload',
  22. '#title' => t('Upload files'),
  23. '#description => t('This multi-upload widget uses Plupload library.'),
  24. '#upload_validators' => array(
  25. 'file_validate_extensions' => array('jpg jpeg gif png txt doc xls pdf ppt pps odt ods odp'),
  26. 'my_custom_file_validator => array('some validation criteria'),
  27. );
  28. '#plupload_settings' => array(
  29. 'runtimes' => 'html5',
  30. 'chunk_size => '1mb',
  31. ),
  32. );
  33. - #upload_validators - an array of validation function/validation criteria pairs, that
  34. will be passed to file_validate().
  35. Defaults to:
  36. '#upload_validators' => array(
  37. 'file_validate_extensions' => array('jpg jpeg gif png txt doc xls pdf ppt pps odt ods odp'),
  38. );
  39. - #plupload_settings - array of settings, that will be passed to Plupload library.
  40. See: http://www.plupload.com/documentation.php
  41. Defaults to:
  42. '#plupload_settings' => array(
  43. 'runtimes' => 'html5,flash,html4',
  44. 'url' => url('plupload-handle-uploads', array('query' => array('plupload_token' => drupal_get_token('plupload-handle-uploads')))),
  45. 'max_file_size' => file_upload_max_size() . 'b',
  46. 'chunk_size' => '1mb',
  47. 'unique_names' => TRUE,
  48. 'flash_swf_url' => file_create_url($library_path . '/js/plupload.flash.swf'),
  49. 'silverlight_xap_url' => file_create_url($library_path . '/js/plupload.silverlight.xap'),
  50. ),