Skip to Content

Actual file path when using UI FileUpload

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 ?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Jul 02, 2013 at 12:50 PM

    Hello Kalid,

    Refer following thread.Hope it might helpful to you.

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

    Thanks

    KH

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 02, 2013 at 12:58 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 02, 2013 at 01:41 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Khalid Sarfaraz

      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