How do I convert an uploaded file from apache’s UploadedFile class to a java.io.File class?
How do I convert an uploaded file from apache’s UploadedFile class to a java.io.File
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Looking at the documentation (
UploadedFileandFile) for both classes, here’s one solution.Since you can access the
InputStreamof theUploadedFile, you can read in the data of the uploaded file and write it to a temporary location or another location that your application can manage.