cancel
Showing results for 
Search instead for 
Did you mean: 

create File in client machine

nikhil_bose
Active Contributor
0 Kudos

hi experts!

is there any way to create Files in client filesystem without using FileDownloadUIElement ?

nikhiL

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Nikhil,

I don't think there's any straightforward way available to do so. Can you share what's your requirement so that i can suggest if any other alternate option is available for the same.

Regards,

Ravi

Answers (3)

Answers (3)

Former Member
0 Kudos

Please Help!!!

(we are currently on NW04)

We were able to launch an applet in webdynpro but I want to make sure it is the right approach and if we will be able to do it in NW04s.

Our requirement is: From Webdynpro Java be able to call an applet on the ixos server for the purpose of viewing tiff images of invoices. Basically, we provide this applet with a URL that identifies the document in IXOS.

Here's how I accomplishe this on our NW04 system...(please tell me if this will work on NW04s and the correct way of doing it)

I built an HTML file in a string which contains javascript to launch the IXOS viewer applet...which is the "inString" below...


		
		try
		{
			String html = inString;
			IWDCachedWebResource resource = WDWebResource.getWebResource(inString.getBytes("UTF-8"), WDWebResourceType.HTML);
			resource.setResourceName("HTML_inline.html");
			resource.setAttachement(false);
			resource.setReadOnce(false);
			wdContext.currentContextElement().setOut(resource.getAbsoluteURL());
		}
		catch (final Exception ex)
		{
			wdComponentAPI.getMessageManager().reportException(new WDNonFatalException(ex), false);
		}

		IWDWindowInfo windowInfo = wdComponentAPI.getComponentInfo().findInWindows("PopupImageViewer");
		IWDWindow window = wdComponentAPI.getWindowManager().createWindow(windowInfo, true);
		window.setTitle("Image opening in separate window");
		window.setWindowPosition(25, 225);
		window.open();
		wdContext.currentPopupElement().setWindowInstance(window);


wdContext.currentContextElement().setOut(resource.getAbsoluteURL());

This line of code will set "Out" in the context, where on another window (PopupImageViewer) will display the HTML in an iFrame with the source of the iFrame pointing to "Out".

nikhil_bose
Active Contributor
0 Kudos

dear Ferguson,

I am not sure saying this approach has flaws. Why don't you start a new thread? I think if there is no thread which could solve your problem, better we create a new thread for the same.

good luck

nikhil

Former Member
0 Kudos

Web application can not create files on the client machine without client's consent. Its a big security risk; just imagine if your web browser start creating files on your machine without informing you, what damage it could cause.

There are few ways to do this in normal web application:

1. Give a download options to your user.

2. Write an ActiveX control or Java applet(doubt applet could work) to do this task but client has to accept this control once before the control starts functioning. This will require client side scripting which isn't possible in web dynpro because of serverside eventing mechanism.

regards,

Jawed Ali

nikhil_bose
Active Contributor
0 Kudos

hi javed,

can you give some more on activex in dynpro ?

still, please tell if anyway out there

- nikhiL

Former Member
0 Kudos

There is no support for ActiveX or Java applets in Web Dynpro applications. What is your use case?

Armin

nikhil_bose
Active Contributor
0 Kudos

hi armin

I have few questions like

1. is it possible to get deployableObject of normal webdynpro project (without using DC) ?

2. how can a generated pdf be stored in local file system( of client) ?

3. which UIElement suits my need ( for qstn 2) ?

4. is there any alternative ways for storing file is client system as File Download UIElement does ?

-nikhiL

Former Member
0 Kudos

1. Using DCs is recommended for productive applications

2.-4. Create the PDF on the server and use a FileDownload element

Bertram's article may also help:

https://www.sdn.sap.com/irj/sdn/wiki?path=/x/0mq

Armin

Former Member
0 Kudos

Hi,

No because Webdynpro doesnt support client side scripting.

Regards

Ayyapparaj