the client supposed to to upload a .ppt file , and the server supposed to save it and display it.
I did stored the (request.getContent() )in a DatainputStream object.
DataInputStream pptFile = new DataInputStream(request.getInputStream());
But I cannot assign this type of variables ( DataInputStream) into an object from the library (org.apache.poi.hslf.usermodel.SlideShow).
DataInputStream pptFile = new DataInputStream(request.getInputStream());
SlideShow ppt = new SlideShow ( pptFile );
I need to use the pptFile as a FileInputStream variable, I know that I can convert from FileInputStream to DataInputStream easily, but How can I do the opposite? (Converting from DataInputStream to FileInputStream)
OR
At least Can I store the (request.getContent) inside a FileInputStream ??
DataInputStreamis not an appropriate class for your requirements (read its Javadoc more carefully).You can store the request in a
ByteArrayInputStreamand then provide that to theSlideShowobject. This might use up a lot of memory (PPT files can get many megabytes in size), but get that working first. Then, investigate using a temporary file to save the upload instead of keeping it in memory.