FriendsOfCake / cakephp-upload

CakePHP: Handle file uploading sans ridiculous automagic
https://cakephp-upload.readthedocs.io/
MIT License
551 stars 255 forks source link

How to use nameCallback #447

Closed manish-evolt closed 7 years ago

manish-evolt commented 7 years ago

I have just installed your plugin but I want to generate random name for each file is being upload. Therefore I want you to send me some example to use nameCallback

Thanks

josegonzalez commented 7 years ago

From the docs:

- nameCallback: A callable that can be used by the default pathProcessor to rename a file. Only handles original file naming.

  - Default: NULL
  - Available arguments:
    - array $data: The upload data
    - array $settings: UploadBehavior settings for the current field
  - Return: (string) the new name for the file

Is there something unclear about that? Please let us know so we can update the docs as appropriate.