on 03-16-2010 10:13 AM
Hello!
First of all I want to see that i am a beginner concerning Web Dynpro.
In the last weeks I made a lot of steps but now i am stuck with a problem, i didn't find a helpful solution for.
I want to create a textfile dynamically via web serivce. That works fine.
Now I am looking for a solution to write this file on client hd.
Is there a possibility to use simply the Java "File" class and give the path name or do I have to use the wd download ui?
For the downloadUI I only found examples concerning Files in MIME but i don't know what to do if my file is dynamically created during runtime and not stored on any hard disc.
I would be grateful if you could get me some hints to find the right way.
Hi
FileDownload UI is what you should be using!
Bind the 'resource' property of the FileDownload UI element to a context attribute (say with name SomeFile) of type
com.sap.ide.webdynpro.uielementdefinitions.Resource
in local dictionary. Insert the following piece of code where the file content is dynamically being generated.
Byte[] dynamicFileConent = yourFileContentGenerateMethod(); // your logic
IWDResource resource =
WDResourceFactory.createResource(dynamicFileConent ,"FILE_NAME.TXT",WDWebResourceType.UNKNOWN);
wdContext.currentContextElement().setSomeFile(resource); // SomeFile is the name of the Context Attribute
Regards
kk
Edited by: kaushal kishore on Mar 16, 2010 6:45 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>
> Hey kk!
>
> thank you for your answer and the code example.
> This is what I was looking for!!! Nice.
>
> I also have to bind the 'data' property of the downloadUI element.
> In your example the value of 'dynamicFileConent' has to be bound that property element....am I right?
Hi
No need to bind the 'data' propery of the downloadUI element. Just bind the 'resource' property of the FileDownloadUI element to the context attribute as suggested in my previous reply.
Binding 'data' property was the older way of doing things.
Regards
kk
Hi,
The only way to do it is by using signed ActiveX (FSO) on IE explorer or signed applet.
This is due security reasons - a web server cannot access client machine...
In case you're in intranet environment and you're working with IE it's possible by changing some parameters in the IE configuration and using FSO.
Regards,
Omri
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.