I am using vertx-web and trying to upload file. Here is my code:
router.route().handler(BodyHandler.create().setUploadsDirectory("some/path/uploads"));
router.post("/api/upload").handler(routingContext -> {
for(FileUpload f : routingContext.fileUploads()){
System.out.println(f.fileName()); // logo.png
}
routingContext.response().end()
});
Above code, uploads file to the given path, but the uploaded file extension is missing.
File upload name: logo.png
File saved name: 45edd7b4-5287-4fba-927e-f256f4b09aea
I want the uploaded file extension and the content-type to remain as it is.