You can use the File Upload and Portal Document Manager Access builders to put a file in Document Manager.
With the File Upload builder, you can load a file from the client to a configurable directory on the server hosting the web application. The Portal Document Manager Access builder uses the uploaded file as the value for the data
property on the document to be saved in the Document Manager.
Follow these steps to enable your application to upload files from the client.
- Create a page in your model.
- Create a tag on this page where you want the File Upload builder to be located.
- Add a File Upload builder to your model.
The builder inputs require you to select the page tag that indicates where the builder should be located. Optionally, you can select a subfolder of the upload directory in which the file is saved.
- Enable the File Upload builder in override.properties.
- Add a Portal Document Manager Access builder to your model (or edit an existing one).
For the File Upload Tag input, use the same tag name you chose in the File Upload builder inputs.
At runtime, the Portal Document Manager Access builder checks the request inputs for a key and value pair that the File Upload builder sets and that specifies the file system location of the uploaded file. If the file is found, it is converted to a Content Model API DataStream
object and set as the data
property on the document to be saved.
- The uploaded files are not deleted from the file system hosting the web application. You can implement a strategy for periodically deleting these files.
- To prevent multiple people simultaneously uploading a file with the same file name, implement code to generate a unique file name for the uploaded file.
- Be sure to enable the File Upload builder in override.properties.
Parent topic: Portal Document Manager Access builder: wpf7