hi,
i have to provide an option for user to upload a file on website.
i am using af:inputFile and able to get file in UploadedFile object.
now i've to transfer this file to a server and that server's API is expecting javax.activation.DataHandler object.
does anyone know how to convert UploadedFile to DataHandler?
DataHandler has constructor which accepts URL - but i don't know how to convert UploadedFile to URL (i know java.io.File can be converted to java.net.URL).
It also accepts DataSource interface but I don't know how to create FileDataSource from UploadedFile?
It has another constructor which accepts data (Object) and MIME type - again how to convert UploadedFile to data Object?
I don't want to write file to a temporary location and read it in File object.
any help?
thanks.