I'm creating a module which uses the Form API and integrates with the Mantis bugtracker system. I have included a managed file field on the form and am at the stage of handling the form submission. The Form API documentation mentions that you must make a call to file_usage_add:
Without the call to file_usage_add, file_managed_file_validate produces an error upon saving the form, saying that the uploaded file may not be referenced.
Here is the signature for file_usage_add():
file_usage_add(stdClass $file, $module, $type, $id, $count = 1)
And the explanation of the parameters:
$file: A file object. $module: The name of the module using the file. $type: The type of the object that contains the referenced file. $id: The unique, numeric ID of the object containing the referenced file. $count: (optional) The number of references to add to the object. Defaults to 1.
The problem I have is that my module doesn't create any nodes to attach the file to. I just want to store the file in the filesystem and then send it off to Mantis.
Any suggestions on what I can enter for the $type and $id parameters?