cancel
Showing results for 
Search instead for 
Did you mean: 

Actual file path when using UI FileUpload

0 Kudos

I want to read the actual file path so that I can archive the file.

The issue is when I am using UI Element Fileupload, it always shows C:\fakepath\filename.txt in filename property of UI.

Is there a way I can get the actual file path or what is alternative ?

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member186016
Active Contributor
0 Kudos

Hi Khalid,

Have you tried this tutorial:

http://wiki.sdn.sap.com/wiki/display/WDABAP/Upload+and+Download+files+in+Webdynpro+ABAP

Regards,

Ashwani Kr Sharma

0 Kudos

I have tried this but still I don't get the actual file path.

I get "C:\fakepath\demo1.txt" in file name.

former_member192434
Active Contributor
0 Kudos

UI Fileupload takes correct path for uploading the file.But when you read the Node Attribute, it shows only File Name and not complete path.so workaround would be:

1 .you can save the file to upload in 'D' Drive in specific folder. And in the coding file name is concatenated with 'D:' to create complete file path.
2.  Uplaod the file in table and then read the complete path of the file

Hope this will help

Ab

Former Member
0 Kudos

Hi Khalid,

You can get the full file path. Please try the below mentioned code:

DATA : lv_file_upload TYPE REF TO cl_wd_file_upload,

             lv_filename TYPE string.

           lv_file_upload ?= wd_this->mr_view->get_element( 'FILEUPLOAD' ).

          

          * FILEUPLOAD is the ID of the fileupload Ui element.

           lv_filename     = lv_file_upload->get_file_name( ).

Regards,

Sanjeev Kotwal.

Former Member
0 Kudos

Hello Kalid,

Refer following thread.Hope it might helpful to you.

http://scn.sap.com/thread/3285845

Thanks

KH