Extend FormResponseFilePathStrategy for MOVEit
This article describes how to change the way file paths are generated for files that you transfer and store in MOVEit. The folder structure in MOVEit depends on the file path. By default, all files uploaded through a specific form are stored in the library for that form. This means that in MOVEit, they are located in a single folder. This makes it difficult to associate already uploaded file with a specific form response. If you want to have control on the folder structure of the uploaded files in MOVEit, you can implement custom
FormResponseFilePathStrategy as described below.
Implement custom FormResponseFilePathStrategy
FormResponseFilePathStrategy, you must register a class in the
ObjectFactory that inherits from
You can override the following methods:
GetRelativeFilePath(FormDescription form, FormEntry response, string originalFileName, string fileUploadFieldName, out string description)
This method allows you to control the folder structure of the uploaded file. The returned path is a string of segments, separated by backslashes (/). The last segment in the path is the file name. To build the custom path, you can use data from the current context, such as current site or current language.
The following parameters provide more specific context about the form submission:
form - (FormDescription) the metadata of the form
response - (FormEntry) the data from the other fields in the form response
originalFileName - (string) the original name of the uploaded file
By default, it is used as the last segment in the path.
fileUploadFieldName - the name of the field through which the file is uploaded
If you have more than one
FileUpload fields in the form, the method will be executed for each of them with a different value of this parameter.
description - an output parameter that returns additional information about the uploaded file, besides the returned path
This method allows you to control the name of the library that is created for the specified form. It is called when a form with a
FileUpload field is published for the first time. Unlike the
GetRelativeFilePath method described above, this method does not use current context data, because it would not be relevant to the uploaded file.
FormResponseFilePathStrategy for your MOVEit integration, implement the following code in the
Global.asax file of your project: