0

Can someone help me on jsp file uploading

i want to create a directory and uplaod a file inside the directory using MultipartRequest but i could not able to get the directory values from the url because request.getParameter() is not working and first i want to get the values from the url then add it to path then upload it.

8th Sep 2018, 2:29 PM
Ashish Kumar
1 Odpowiedź
0
Hope it helps private static String UPLOADED_FOLDER = "src//main//webapp//Product Images//"; public Product addProduct(MultipartFile productImage) { try { byte[] imageInByte = productImage.getBytes(); Path path = Paths.get(UPLOADED_FOLDER + productImage.getOriginalFilename()); Files.write(path, imageInByte); } catch(Exception e) { e.printStackTrace(); }
12th Sep 2020, 4:24 PM
vickyvirus
vickyvirus - avatar