README.txt 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. '#submit_element' => '#id-of-your-submit-element',
  25. '#upload_validators' => array(
  26. 'file_validate_extensions' => array('jpg jpeg gif png txt doc xls pdf ppt pps odt ods odp'),
  27. 'my_custom_file_validator' => array('some validation criteria'),
  28. );
  29. '#plupload_settings' => array(
  30. 'runtimes' => 'html5',
  31. 'chunk_size' => '1mb',
  32. ),
  33. );
  34. - #submit_element - optionally specify which submit element plupload shall use
  35. to submit the form. See: http://drupal.org/node/1935256
  36. - #upload_validators - an array of validation function/validation criteria pairs, that
  37. will be passed to file_validate().
  38. Defaults to:
  39. '#upload_validators' => array(
  40. 'file_validate_extensions' => array('jpg jpeg gif png txt doc xls pdf ppt pps odt ods odp'),
  41. );
  42. - #plupload_settings - array of settings, that will be passed to Plupload library.
  43. See: http://www.plupload.com/documentation.php
  44. Defaults to:
  45. '#plupload_settings' => array(
  46. 'runtimes' => 'html5,flash,html4',
  47. 'url' => url('plupload-handle-uploads', array('query' => array('plupload_token' => drupal_get_token('plupload-handle-uploads')))),
  48. 'max_file_size' => file_upload_max_size() . 'b',
  49. 'chunk_size' => '1mb',
  50. 'unique_names' => TRUE,
  51. 'flash_swf_url' => file_create_url($library_path . '/js/plupload.flash.swf'),
  52. 'silverlight_xap_url' => file_create_url($library_path . '/js/plupload.silverlight.xap'),
  53. ),