Uploaded files

Uploaded file metadata should be validated, then accepted files moved to an application-controlled location.

Target guide

Signature

1web_request->fileUploads()

Uploaded file metadata should be validated, then accepted files moved to an application-controlled location.

Uploaded files is a guide page for a common LaiRu workflow. Uploaded files belongs at the request or response boundary. Treat visitor input as untrusted, validate before use, and encode values before writing them into HTML.

Examples

Basic call

1with upload in web_request->fileUploads do => {2    file(#upload->find('path'))->moveTo('/uploads/' + #upload->find('filename'), true)3}
The example belongs near a request or response boundary; validate visitor input before trusting it.