Hi Everybody,
I want to display JPG images in my Web Dynpro Java Application. The images are stored in a PC, but I dont want to open the file explorer and select the file using FileUpload UI. I need to write in my code a path like this: D:\100301.jpg and display the image.
I have used this code and it doesn't work, but if I choose the file with the FileUpload UI, the image is displayed succesfully.
String file = "D:\\100301.jpg";
IWDResource resource = null;
try {
resource = WDResourceFactory.createResource(file.getBytes(),"100301",WDWebResourceType.JPG_IMAGE);
wdContext.currentResourceElement().setImgResource(resource);
wdContext.currentResourceElement().setImgURL(
wdContext.currentResourceElement().getImgResource().getUrl(WDFileDownloadBehaviour.OPEN_INPLACE.ordinal()));
} catch (Exception e) {
e.printStackTrace();
}
The attribute ImgURL is bound to the image source property.
So, can someone help me with any suggestion in order to solve this issue?
Thanks!!!