Class FileController

java.lang.Object
formflow.library.FormFlowController
formflow.library.FileController

@Controller @EnableAutoConfiguration public class FileController extends FormFlowController
  • Constructor Details

  • Method Details

    • upload

      @PostMapping(value="/file-upload", consumes="multipart/form-data") @ResponseStatus(OK) public org.springframework.http.ResponseEntity<?> upload(@RequestParam("file") org.springframework.web.multipart.MultipartFile file, @RequestParam("flow") String flow, @RequestParam("inputName") String inputName, @RequestParam("thumbDataURL") String thumbDataUrl, jakarta.servlet.http.HttpSession httpSession, jakarta.servlet.http.HttpServletRequest request, Locale locale)
      File upload endpoint.
      Parameters:
      file - A MultipartFile file
      flow - The current flow name
      inputName - The current inputName
      thumbDataUrl - The thumbnail URL generated from the upload
      httpSession - The current HTTP session
      Returns:
      ON SUCCESS: ResponseEntity with a body containing the id of a file. body.

      ON FAILURE: ResponseEntity with an error message and a status code.

    • delete

      @PostMapping("/file-delete") public org.springframework.web.servlet.view.RedirectView delete(@RequestParam("id") UUID fileId, @RequestParam("returnPath") String returnPath, @RequestParam("inputName") String dropZoneInstanceName, @RequestParam("flow") String flow, jakarta.servlet.http.HttpSession httpSession, jakarta.servlet.http.HttpServletRequest request)
      Parameters:
      fileId - The id of an uploaded file that should be deleted
      returnPath - The path to the page that they came from
      dropZoneInstanceName - The drop zone instance used to get the user file name
      flow - The name of the current (active) flow
      httpSession - The current HTTP session
      Returns:
      ON SUCCESS: Returns a RedirectView to the returnPath

      ON FAILURE: Returns a RedirectView to the 'error' page

    • downloadSingleFile

      @GetMapping("/file-download/{flow}/{submissionId}/{fileId}") public org.springframework.http.ResponseEntity<org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody> downloadSingleFile(@PathVariable String submissionId, @PathVariable String fileId, @PathVariable String flow, jakarta.servlet.http.HttpSession httpSession, jakarta.servlet.http.HttpServletRequest request)
      Parameters:
      submissionId - The submissionId of the file to be downloaded
      fileId - The UUID of the file to be downloaded.
      flow - The name of the current (active) flow
      httpSession - The current HTTP session
      request - The HttpServletRequest
      Returns:
      ON SUCCESS: ResponseEntity with a response body that includes the file.

      ON FAILURE: A ResponseEntity returns an HTTP error code

    • downloadAllFiles

      @GetMapping("/file-download/{flow}/{submissionId}") public org.springframework.http.ResponseEntity<org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody> downloadAllFiles(@PathVariable String submissionId, @PathVariable String flow, jakarta.servlet.http.HttpSession httpSession, jakarta.servlet.http.HttpServletRequest request)
      Parameters:
      submissionId - The submissionId of the all the files that you would like to download.
      httpSession - The current HTTP session.
      flow - The name of the current (active) flow
      request - The HttpServletRequest
      Returns:
      ON SUCCESS: ResponseEntity with a zip file containing all the files in a submission.

      ON FAILURE: ResponseEntity with a HTTP error message