A
A
Alexey Kopendakov2018-07-04 11:47:06
Java
Alexey Kopendakov, 2018-07-04 11:47:06

What can be used to transfer files to the server?

Good afternoon.
Ask such a question.
I need to write an application that will convert the video and upload it to the server.
Reconverting is understandable, but what to use to upload files to the server?
Finishing the server is not a problem.
As I did not try to find, but I can not properly formulate the question in order to find the answer.
PS. The channel for pouring is narrow and not very stable. That is, you need to resume and check ....

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
bedward70, 2018-07-04
@alex_kag

One of the answers

L
LS Timer, 2018-07-04
@light___soul

If the server is on Spring then CommonsMultipartResolver
Bean

private int maxUploadSizeInMb = 1024 * 1024; // 1 MB
    @Bean
    public CommonsMultipartResolver multipartResolver(){
        CommonsMultipartResolver cmr = new CommonsMultipartResolver();
        cmr.setMaxUploadSize(maxUploadSizeInMb * 10);
        cmr.setMaxUploadSizePerFile(maxUploadSizeInMb * 5);

        return cmr;
    }

Called like this
@ResponseBody
    @PostMapping(value = "/upload")
    public String setUpload(@RequestParam("upfile")MultipartFile file) {

    }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question