I am having issue when i save a png file uploaded by user . It loses its transparency . Here is how I save it .
ServletFileUpload upload = new ServletFileUpload(factory);
ProgressListenerImpl listener = new ProgressListenerImpl();
UploadProgressBar uop = new UploadProgressBar(listener);
List<FileItem> fileItemsList = upload.parseRequest(request);
for(FileItem fi : fileItemsList) {
///get name etc.
File fNew= new File(fileLocation, justName);
fi.write(fNew);
}
it puts a black background . Any other way to save it as png ?
If you’re creating a BufferedImage on the server side, make sure you create it as a type that supports the alpha channel, e.g.
Paul