cancel
Showing results for 
Search instead for 
Did you mean: 

Path to (dynamic) image files on the WAS Server - Web Dynpro

Former Member
0 Kudos

Hello again with a new question ...

I wrote a Web Dynpro Application, that uploads images from the client and stores them in a directory on the server. In the next step the WD Application reads the contents of that directory (for Example 1.jpg, 2.jpg, 3.jpg) and shall display these pics (dynamically).

The only thing that does not work is displaying the images. I do not know how to address them; i simply can not see them.

My application is running on a windows host in path "E:\usr\sap..."

The Pics are uploaded into the server directory "E:\ZZZ\"

<b>Following code shows the pics</b>, when i use a browser on the server itself. When i try it from another machine, is doesn't work. Seems as if the supplied path is a local path, not a server path.

IWDImage image11 = (IWDImage) view.createElement(IWDImage.class, "TestBild" + i);

image11.setAlt("file:///" + files<i>.toString());
image11.setSource("file:///" + files<i>.toString());
// files<i>.toString() contains: \E:ZZZ1.jpg

theGroup.addChild(image11);

<b>Thank you !!</b>

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Two remarks:

1. For creating URLs on the server, use the WDURLGenerator class.

2. For creating UI elements with an anonymous ID, simply use view.createElement(<UI element API>, null).

See https://media.sdn.sap.com/javadocs/NW04/SP12/webdynpro/com/sap/tc/webdynpro/services/sal/url/api/WDU...

Armin

Former Member
0 Kudos

Armin, thank you, just solved the problem

I found a post telling something about HTTP aliases and this weblog

/people/renjith.andrews/blog/2005/03/31/creating-an-http-alias-in-was

So i created an alias (ZZZ for Hard drive directory "E:\ZZZ") and use it in the code for example:

image11.setAlt("http://netweaver:50000/ZZZ/0000009502_0002000197_2_002.jpg");
image11.setSource("http://netweaver:50000/ZZZ/0000009502_0002000197_2_002.jpg");

Now i see the images within my WDView