cancel
Showing results for 
Search instead for 
Did you mean: 

Directory Chooser, File Chooser

Former Member
0 Kudos

I would like to choose a directory and in another case a file using WebDynpro. I find no UI element that gives me a File object (which would give me a path) for this.

And yes, I want this on the client and on the server.

did I miss out something ?

Walter

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello Karin,

I want to do a picture show. First, I want to choose a directory on the webserver. Then I want the first File object. When the user presses the "Next" button, an iterator shall give me the next File object from the directory.

Another example: I want to write to a file from my WebDynpro App; and I want to choose the target file interactively.

I found I cannot do this by (mis)using the Upload and Download UI Elements.

greetings

Walter

Former Member
0 Kudos

Q1. You could use the FileUpload UI element for choosing a directory. you could write some Java code to get the list of files from the directory. To have a slide show on the View itself, please have an I frame on the view and change the URL dynamically on clicking the "Next" Button.

Q2.You should be able to use the Office Integration UI element.

Cheers,

Sam

Former Member
0 Kudos

Hi Sam,

in the FileUpload UI element I don't see the directory anywhere, all I get is a filename (without a path) and binary data.

The OfficeControl also has no directory or file browser.

Correct me if I am wrong, but please add a complete description of how to achieve my goal.

regards, Walter

Former Member
0 Kudos

Walter,

For ease, please see the example in the below link for the File Upload and Download UI examples which Karin has put in one of the mail threads. You could download it

http://sapmats-de.sap-ag.de/download/download.cgi?id=5K7EPLB7EVF9CXQUXGEJNNMSYWZ8XX8VUQDU61CO88MT7ND...

You could use the FileUpload elements Directory browse feature for getting the path for setting the path of the office document that has to be displayed through OfficeControl UI Element.

If this couldn't help you please let me know..

Thanks and Regards,

Sam

Former Member
0 Kudos

Sam,

I have studied that example before I started this thread.

Using the FileUpload dialog we can nicely browse directories and identify a file this way. Now can someone show me how to access the chosen directory inside the view controller implementation (a.k.a. "the program")?

greetings, Walter

Former Member
0 Kudos

Hi Walter,

I don't think there is a straight option for you to choose a folder using the FileUpload tool. But a round about would be to force the user to choose the very first file which you want to put in the slide show, and the programmatically get the directory path(filepath-filename) from the file path. Use this directory path to display your files through an Iframe or some other output method.

Thanks and Regards,

Sam Mathew

gregorw
Active Contributor
0 Kudos

Hello Walter,

I think you have to understand the difference between a Web Application running in a Browser Window what Web Dynpro is and a Dynpro program running in the Fat Client SAP GUI. Because of security reasons the Web Server is not allowed to access the harddisk of the client.

One solution could be that you force the user to pack all files in one ZIP-File and to upload that to the server where it can be extracted.

Regards

Gregor

Former Member
0 Kudos

Hello Walter,

I am not quite sure, what you want to achieve:

- would you like to upload or download a file?

FileUpload: You can use the FileUpload UI element to upload files from the client to the server. The UI element appears with an input field, in which the directory path and the file name appear, and a button for searching for the file

FileDownload: You can use the FileDownload UI element to load files from the server to the client. The data property determines the data source in the context. The target property determines the ID of the target window in the browser.

- or would you like to display an Office document?

The Office Integration library features the OfficeControl UI element, which enables you to display the following documents:

· Microsoft Word documents with extension doc

· Microsoft Excel documents with extension xls

· Star Office text documents with extension sxw

· Star Office spreadsheet documents with extension sxc

Detailed information about one of the above topics can be found within the documentation http://help.sap.com/saphelp_nw04/helpdata/en/13/a3bb3eff62847ae10000000a114084/frameset.htm (standard library or office integration library).

If you want to achieve something else, could you please describe a bit more detailed?

Hope that helps!

Karin