cancel
Showing results for 
Search instead for 
Did you mean: 

FileUpload UI

Former Member
0 Kudos

Hi all,

I use a FileUpload UI element in a Web Dynpro application to allow the user to upload a file to the R/3 system via a BAPI.

I have two questions about the FileUpload:

1°) I need to know the file size, before sent it to the BAPI and I have seen that the only way to do this is to do this code:

InputStream stream = resource.read(false);

Double size = stream.available();

The problem is that if the user choose a large file, the first instruction will take a long time.

Is there a way to know the size after picking the file from the file chooser ?

2°) All the Web Dynpro applications and data are in english. I can't find a way to change the text in the Browse button of the FileUpload UI. It seems to be bind to the browser language but our users are from diffrent nationnality and we need to fix the button text in english.

How can i fix it ?

Thanks and regards,

Nicolas

Accepted Solutions (0)

Answers (2)

Answers (2)

p330068
Active Contributor
0 Kudos

Dear Nicolas,

For you message point 1 about fileupload UI. you can find the size with the code metioned by you. I am using the same for the find the size of the uploaded file.

In the webdynpro view, you can add the FileUpload UI and Add / Upload button in it. In the Add / Upload, you use the code and show the message for size.

Then you use the submit button if it file size is OK.

For you second point : you can use the internationalization of the webdynpro application, please search the SCN for more details.

Hope it will helps

Best Regards

Arun Jaiswal

Former Member
0 Kudos

Thanks for your replies.

I know that i can have the file size once the file is uploaded to application server but if the user choose a file of 200 MB for exemple, i want to not allow him to click on the upload button, because it will take a long time to upload this file.

For internationalization of Web Dynpro applications, if i well understood, is to modify the .xlf files properties but i don't see any properties concerning the FileUpload UI.

Jun, I logged off, close my browser and log on. Button is still in french.

Regards,

Nicolas

junwu
Active Contributor
0 Kudos
can you upload a screenshot regarding the language setting?
Former Member
0 Kudos

I go to User Administration -> Identity Management -> General Information tab and set the language:

junwu
Active Contributor
0 Kudos
are you login with this account sapuser?
why the security policy is "technical user"?
Former Member
0 Kudos

No it's i'm login with an admin user.

Security policy is technical user to not allow the user to change his password.

junwu
Active Contributor
0 Kudos

buddy......

you have to change the language of the login user.

Former Member
0 Kudos

You don't understand...

I need to log in with an admin user to change the test user settings... That's what i've done and when i log in with my test user, text button doesn't change.

junwu
Active Contributor
0 Kudos


really don't know who don't understand.

YOU HAVE TO CHANGE THE LANGUAGE OF THE TEST USER

OK!!!!!!!!!!!!!!!!!!!

junwu
Active Contributor
0 Kudos


seems sapuser is the connection user?

if yes, it has nothing to do with test user's UI display.

UI display depends on the language of logged in user.

Former Member
0 Kudos

sapuser IS the test user.....

junwu
Active Contributor
0 Kudos

i tested in my environment, it works.

how you run the application? using application url or iview?

are you using federated portal?

what's the version of your portal?

Former Member
0 Kudos

Applications running on an iView.

I'am using federated portal but the application runs on the producer portal (where i test the application and where i've set the language user).

Version is CE 7.2.

junwu
Active Contributor
0 Kudos

if you directly access it form CE and it still has issue after the language configured, i am really lost, no idea....

Former Member
0 Kudos

In your environement, if you change the user's language to french (for exemple), it changes the text of the browse button of the FileUpload UI ?

junwu
Active Contributor
0 Kudos

strange, in my environment, it always display english.

my browser is set to German.

i tried "French", "German" for the test user in ume, in both case it display english, but other sap application is displaying correct language.

my server CE7.2 SP6

Former Member
0 Kudos

Yes, i have the same behavior but with French language.

My browser is set to English, but my operating system is Windows XP in french.

What's your's ?

junwu
Active Contributor
0 Kudos
my os is xp english
i think language is determined in following sequence
url locale>user locale>browser local>application locale>system locale>vm locale
Former Member
0 Kudos

So, you think that i have to change url locale to English ?

If yes, how to do that ?

junwu
Active Contributor
0 Kudos
i tried it didn't help.
yoururl?sap-locale=en
p330068
Active Contributor
0 Kudos

Dear Nicola,

Have you refer to the thread. I think its not possible.

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

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

But In the same time in the article, button text has changed...

http://scn.sap.com/docs/DOC-2561

For webdynpro application text will work with internationalization. I think it will not work with user browsers or user language changes.

Hope it will helps.

Best Regards

Arun Jaiswal

Former Member
0 Kudos

Ok i think that is linked to the user's OS because server's OS are in English.

I noticed also something. If you click on the browse button in NWDS on the FileUpload UI, file chooser appear...

I really don't know how this component works.

Anyway, thanks for your help.

junwu
Active Contributor
0 Kudos

Arun Jaiswal wrote:

For webdynpro application text will work with internationalization. I think it will not work with user browsers or user language changes.

are you really sure for this point ? have you tried in system?
if you set the language of the user, the standard sap application will be displayed in that language.
if you didn't set the language of the user, the browser language will be taken.
p330068
Active Contributor
0 Kudos

Dear John,

Yes, I have tested it. Only standard SAP content are working with user's browser or language changes. It it not working with custom Webdynpro application.

But as per blog metioned in my previous post, FileUpload Button text showing other than english.

Thats true it will take the browser language but not with the case custom wd application.

Best Regards

Arun Jaiswal

junwu
Active Contributor
0 Kudos

no, you cannot say it didn't work with customized wd.

the customized wd is not internationalized...... no matter what you set, only one language will be dsiplayed.

p330068
Active Contributor
0 Kudos

Dear John,

That's what I have said

The custom webdynpro is not taking the user's browser or UME language.

Best Regards

Arun Jaiswal

junwu
Active Contributor
0 Kudos
no,no....
the language is taken, but the customized wd cannot display that one, so it display the default one, which is the only one it has,
p330068
Active Contributor
0 Kudos

May be that is the case. but it is working in the http://scn.sap.com/docs/DOC-2561

junwu
Active Contributor
0 Kudos

it should work like that, i tested before. don't know why the browse is not translated....

Former Member
0 Kudos

If I look the source code of the application in a browser I can see that the FileUpload UI is generated as an <input> html tag of type="file".

That's why the button will be always in the language of the whole browser. Change the language settings of the browser has no effect because it takes the native language of the browser.

junwu
Active Contributor
0 Kudos

yes, i think you find the root cause,

it is using the native UI element.

junwu
Active Contributor
0 Kudos
for point 1,if you are using standard file upload UI element, i think it is not possible
point 2, you can set the user's language to english in UME. the browser button  will be displayed in english only.
Former Member
0 Kudos

What can i use instead of standard file upload UI element to upload a file ?

For point 2, i try to set the language of a test user to English but it doesn't work (My browser is in french and the text is still in french).

Regards,

Nicolas

junwu
Active Contributor
0 Kudos
did you logoff and login with the user? refresh won't work,