cancel
Showing results for 
Search instead for 
Did you mean: 

File Upload UI element: Error when uploading; the file name is invalid

Former Member
0 Kudos

Hi ,

I am trying to upload an Excel file via WDA using File Upload UI element. But application is throwing me following exception when i am trying to click submit button.

Error when uploading; the file name is invalid, or the file is too big

System is throwing above error even for a file with size 12 kb.

Does some one knows, the root cause of this error.

Regards

PG

Accepted Solutions (0)

Answers (4)

Answers (4)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Does this error happen on all file uploads/using different files? In more than just this one application?

Former Member
0 Kudos

Hi Thomas,

This error hapens with all types of file upload.

I tried to upload a text file of 4 kb size, but it's giving me same kind of error.

I tried to create some other application , but I getting similar error for every application, where I am using this upload functionality.

Regards

PG

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

If it happens with all files regardless of size or name, then you have to consider a server misconfiguration. Have you tried this also with a standard SAP demo application?

Perhaps someone incorrectly set the maximum request size parameter:

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/48/69ef8be8a607d6e10000000a42189c/frameset.htm

Former Member
0 Kudos

Hi Thomas,

Thanks for giving me some lead.

I will check the server configuration and will test the sap standard application for the same UI.

Regards

PG

Former Member
0 Kudos

Hi Thomas,

I just test the standard application WDR_TEST_UI_ELEMENTS with 10 kb Excel file and below is the error message displayed.

Fehler beim Hochladen: der Dateiname ist ungültig oder die Datei ist zu groß.

After translating, i get to know that it's same error message , in German.

Regards

PG

Former Member
0 Kudos

Hi Thomas,

I just check the value of parameter icm/HTTP/max_request_size_KB and found that, it's having default value i.e. 102400 .

And I think this value is more than enough to upload my Excelsheet.

Now I am kind of confuse about the cause of this problem since, this problem is happening with the satandard application also.

Please suggest me, if I can look for some other reason or, do we have any other way to upload an Excelsheet in Webdynpro Abap.

Regards

PG

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

If you confirmed that the problem occurs in the standard application and that your server profile parameters are correct, then I would suggest you open a support ticket and let SAP diagnose the problem.

Former Member
0 Kudos

Hi Thomas,

I will open a Ticket with SAP.

But i was just thinking, that does Browser play any role in these kind of errors. Should i change the default brwoser from IE to something else.

Regards

PG

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

I suppose your company could have some browser specific or even firewall specific configuration that could be causing this. Testing with another browser might be helpful, but I don't know if that will give you definative answers. You may still need help from support to determine the true root cause.

Former Member
0 Kudos

Hi Thomas,

I found the root cause!!

It was because of the browser. I am using Windows XP with IE 6. And when I tried to run the same application on IE 8, It's running properly.

But still I don't get about this Browser version dependency.

Thanks for your help and suggessions.

Regards

PG

Former Member
0 Kudos

Hi Thomas/ Pankaj,

I am having the same issue what you are having/faced. I am using IE10 but I am still facing issue with Browse button in File Upload.

I am getting the error  for File Upload UI element: "Error when uploading;
the file name is invalid or the file is too large
"

Could you tell me how it can be resolved ?

Thanks

Satish

ramakrishnappa
Active Contributor
0 Kudos

Hi Raju,

Please refer to sap note:

SAP Note 1791729 - FileUpload error: "Error when uploading; the file name is invalid or the file is too large"

Hope this helps you.

Regards,

Rama

Former Member
0 Kudos

Hi ,

Anyone can provide some input to resolve this issue?

Regards

PG

Former Member
0 Kudos

Hi PG,

My Node has the following attributes:


Node
 |_ FILENAME type string  --> Binded to Filename Property
 |_ CONTENT  type rcf_attachment_content --> Data Property of the Upload UI Element.

Please check the below code, as the same is working for me with this logic.


IF lvfname IS NOT INITIAL.

*determine file name without path
    CALL FUNCTION 'TRINT_SPLIT_FILE_AND_PATH'
      EXPORTING
        full_name     = lvfname
      IMPORTING
        stripped_name = lv_stripped_name
        file_path     = lv_file_path
      EXCEPTIONS
        x_error       = 1
        OTHERS        = 2.

    IF sy-subrc = 0.
      IF NOT lv_stripped_name IS INITIAL.
        lvfname = lv_stripped_name.
      ENDIF.
    ELSE.
* Throw error
      lo_api_controller ?= wd_this->wd_get_api( ).

      CALL METHOD lo_api_controller->get_message_manager
        RECEIVING
          message_manager = lo_message_manager.

*     report message
      lo_msg = 'Please select proper file'.
      CALL METHOD lo_message_manager->report_t100_message
        EXPORTING
          msgid = '38'
          msgno = '000'
          msgty = 'E'
          p1    = lo_msg.
      EXIT.

    ENDIF.

At the same time, I've made use of the class cl_hrrcf_attachment_bl to maintain the attachments in my requirement.

Regards,

-Syed.

Former Member
0 Kudos

Hi Syed,

Thanks for your code.

But I did not get, where can i use this and how this code will help me to resolve the problem.

So can you please explain it in more detail.

Regards

PG

ChrisPaine
Active Contributor
0 Kudos

Hello,

I've sometimes had issues with networked drives not being read correctly - try using the browser "Save page as" functionality - if you can write to the drive - you should be able to read from it.

You are setting the name/location of the file using the "Browse..." button? And you are using a supported browser?

Chris

Former Member
0 Kudos

Hi Chris,

Thanks for your reply.

My application does not even goes to the WDDOMODIFYVIEW method, and this error shows up in the browser.

'Error when uploading; the file name is invalid, or the file is too big'

So following is the detail:

I have a File upload UI element and a button, with name submit. No when I run my application, user selects the upload option of File upload UI element. After selecting the file, user presses submit button. In this submit button i am reading the Excel data and trying to store it in database.

But surprisingly, when user presses submit button, system throws above error without going in Submit action. Then I tried to put Break Point in WDDOMODIFYVIEW method. Since it's called every time. But even system does not goes in this method and throws above error.

So technically I have no clue about the probable cause of above error.

Regards

PG