cancel
Showing results for 
Search instead for 
Did you mean: 

Saving file on server folder

Former Member
0 Kudos

hai all,

In my webdynpro application i'm exporting the contents of a table to an excel file. i want to save that file on a folder in the server as soon as it is generated on running the application. my server and NWDS are on different systems. how can i do that?

thanks in advance

regards

naveen.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi

If you want to put the file in the deployed path of the application you can use the following line of code to get the path

String path = WDURLGenerator.getResourcePath(wdComponentAPI.getDeployableObjectPart())

Create a file in the above mentioned path and write to it.

Regards

Ayyapparaj

Former Member
0 Kudos

thank you ayyapparaj for your response. the problem is solved

Former Member
0 Kudos

Hi Naveen,

Is your problem solved ?

Thanks,

Samta

Former Member
0 Kudos

Hi Samta,

Thank you. The problem is solved.

Best Regards,

Naveen

Former Member
0 Kudos

Hi samta,

please let me know how do i award you points. i am getting an internal server error 500 when i click on the radio button for awarding you points.

BR,

Naveen

Former Member
0 Kudos

Hi Naveen,

Refresh the page, and try again

Thanks,

Samta

Former Member
0 Kudos

Hi Naveen,

This is definitely possible

1) You get the data of the excel file in the the form of outputstream

2) Create a File object, by giving the filepath of the server

3) Attach a FileOutputStream to the file object

File f1 = new File("C:\temp.txt")

FileOutputStream fop = new FileOutputStream(f1);

4) Now write the data you have created in OutputStream in Step 1, to this File OutputStream

5) Flush & Close the FileOutputStream & the file Object

Hope this helps,

Thanks,

Samta