Package io.jmix.rest.impl.controller
Class FileUploadController
java.lang.Object
io.jmix.rest.impl.controller.FileUploadController
@RestController("rest_FileUploadController")
@RequestMapping(path="/rest/files")
public class FileUploadController
extends Object
REST API controller that is used for uploading files
-
Field Summary
Modifier and TypeFieldDescriptionprotected AccessManager
protected FileTransferService
protected Metadata
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
org.springframework.http.ResponseEntity<FileInfoResponse>
uploadFile
(jakarta.servlet.http.HttpServletRequest request, String name, String storageName) Method for simple file upload.org.springframework.http.ResponseEntity<FileInfoResponse>
uploadFile
(org.springframework.web.multipart.MultipartFile file, String name, String storageName, jakarta.servlet.http.HttpServletRequest request) Method for multipart file upload.
-
Field Details
-
metadata
-
fileTransferService
-
accessManager
-
-
Constructor Details
-
FileUploadController
public FileUploadController()
-
-
Method Details
-
uploadFile
@PostMapping(consumes="!multipart/form-data") public org.springframework.http.ResponseEntity<FileInfoResponse> uploadFile(jakarta.servlet.http.HttpServletRequest request, @RequestParam(required=false) String name, @RequestParam(required=false) String storageName) Method for simple file upload. File contents are placed in the request body. Optional file name parameter is passed as a query param. -
uploadFile
@PostMapping(consumes="multipart/form-data") public org.springframework.http.ResponseEntity<FileInfoResponse> uploadFile(@RequestParam("file") org.springframework.web.multipart.MultipartFile file, @RequestParam(required=false) String name, @RequestParam(required=false) String storageName, jakarta.servlet.http.HttpServletRequest request) Method for multipart file upload. It expects the file contents to be passed in the part called 'file'. -
checkFileUploadPermission
protected void checkFileUploadPermission()
-