Script

drop_file()

Handle the dropped file (if there is one).

drop_file()

Handle the dropped file (if there is one).

This function must returns an instance of UploadStatus.

drop_file_pdf()

When a PDF file is dropped the drop_file_pdf function is called.

If not overridden in the user script, this function will first inspect the PDF.

If a schema is found in the PDF and that schema is the same as the current craftform, the function drop_file_pdf_schema_self is called.

If a schema is found in the PDF and that schema is different from the one of the current craftform, the function drop_file_pdf_schema is called.

If we find no schema, the function drop_file_pdf_schema_none is called.

This function must returns an instance of UploadStatus.

drop_file_pdf_schema_self()

If not overridden in the user script, this function will extract the metadata value of the dropped PDF and replace the current values of the form.

The PDF will not be saved in the form session.

This function must returns an instance of UploadStatus.

drop_file_pdf_schema()

If not overridden in the user script, this function will accept the PDF and save it in the form session.

This function must returns an instance of UploadStatus.

drop_file_pdf_schema_none()

If not overridden in the user script, this function will accept the PDF and save it in the form session.

This function must returns an instance of UploadStatus.

drop_file_excel()

TODO: Need to be documented

This function must returns an instance of UploadStatus.

drop_file_{ext}()

TODO: Need to be documented

This function must returns an instance of UploadStatus.

drop_unknown_file()

TODO: Need to be documented

This function must returns an instance of UploadStatus.

return UploadStatus

All the drop_* functions should return an UploadStatus. It will give to the client form some information on how the upload was proceed and what to do client-side.

Sample :

status: accepted
stored: true
msg: "Your order document #344 has been added"

.status

TODO: Need to be documented

.stored

TODO: Need to be documented

.extra_files

TODO: Need to be documented

.form_overload

TODO: Need to be documented

.msg

The message explaining to the user how the upload happened.

.schema

TODO: Need to be documented

.needed_options

TODO: Need to be documented