on 10-17-2009 2:37 PM
Hi Friends,
Would like to enquire one doubt in the file upload object in abap webdynpro.
By default when we press the browse button, near to the file name there is a button which shows the the file types like:
., *.html, ,gif,.jpeg etc.
Is there any way we can control that, as i have an requirement where in to upload only certain extension types.
thankyou.
Hi,
Thanks a lot friiend....Its kind of started working..rest i ll try myself.
Have found out that passing parameter close_in_any_case for window, will disable button, so have to code for the buttons manuallly.
Take care.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
Bind the Mimetype of FileUpload' s property with an attribute of type String.
So after you have uploaded the file using Browse button, you will have the type of file in this attriubte.
Now you can read this file type ( whether JPG,Word,Excel ) and throw error message on any button's action.
If you dont have any action available write the code in WDdomodify but avoid writing in wddomodify.
You must be having some action handler to do validation. Write the code there. It will work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Saurav,
Thanks for your reply. I understood what u told. Would like to ask you one thing as i am new in webdynpro programming.
I have a view with upload object called in a window during an action, now when user presses ok button, and if the extension is not valid, another grid with valid extension types should be populated in the same window, and the window should not close untill the correct extension type is given or when close button is pressed. could u give a logic to implement this.?
good u r online.
From the action handler of the window button i am getting the file type. But the user wants a grid in the same window showing the valid extension types stored in a table, so that the user can enter again uplaod the file before the close of the window.
could u throw a light on this.
HI,
I would suggest you to follow this approach :
1. Create a Table in your View in which FileUpload is there.
2. Populate this value with valid file extension.
3. Make it invisible by default.
4. Now when you have entered value in Fileupload and click on Ok button.
5. Check whether Mimetype matches any value in Table.
6. If it is invalid, Throw an error message and mke Table of Valid extension Visible.
Sample code to have Table with Valid entries.
types : begin of str,
valid_ext type string,
end of str.
data : wa type str,
itab type table of str.
wa-valid_Ext = 'EXL'.
append wa to itab.
wa-valid_ext = 'DOC'.
append wa to itab.
lo_nd->bind_Table( itab ).
here lo_nd is your ref to node of Table having valid extensions.
7. Bind this Table's Visible property wiht wdui_visiblity .
8. Set it Visible - 02 , Inviisible - 01.
I hope it is clear.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.