Alessandro Vasi
Alessandro Vasi

Reputation: 21

Convert FormFile to Java.io.File

I have an object FormFile recovered through a Struts Form . I have to convert Java side in the java.io.File How can I do? The casting in this way by exception:

File myFile = (File) fileFormFile

Upvotes: 2

Views: 12732

Answers (2)

Jayamohan
Jayamohan

Reputation: 12924

Read the API document of FromFile class what methods it all provides. Use getInputStream() method.

Upvotes: 0

FazoM
FazoM

Reputation: 4956

Here, I found something you might use:

http://www.coderanch.com/t/54902/Struts/Struts-FormFile-java-io-File

Upvotes: 2

Related Questions