on 03-13-2012 4:39 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
Arun Jaiswal wrote:
For webdynpro application text will work with internationalization. I think it will not work with user browsers or user language changes.
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
May be that is the case. but it is working in the http://scn.sap.com/docs/DOC-2561
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.