import org.springframework.http.codec.multipart.FilePart;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;
import java.io.File;
@RestController
public class TestController {
@PostMapping("test")
public Mono<R> test(FilePart file){
String fileName = file.filename();
File newFile = new File("F:/images/banner/",fileName);
file.transferTo(newFile);
return Mono.just(R.ok());
}
}
i upload picture and use transferTo method to write file to the dest path. but i can't found the picture in the F:/images/banner/ someone can help me? thanks