getFile file upload


Controller provides the getFile series of methods to support file upload. Special note: If the client request is a multipart request (the form uses enctype="multipart/form-data"), then the getFile series of methods must be called first to make the getPara series of methods work properly. Because multipart request needs to parse the data in the request body, including parameters, through the getFile series of methods.

By default, files are uploaded to the upload subpath under the project root path. This path is called the file upload base path. You can set the file upload base path through me.setBaseUploadPath(baseUploadPath) in the JFinalConfig.configConstant(Constants me) method. This path parameter accepts an absolute path starting with "/" or a windows disk drive letter, and you can point the base path to Outside the project root path, it is convenient for single-machine multi-instance deployment. When the path parameter is set to a relative path, it is a relative path based on the project root.