on 12-31-2012 7:16 AM
i want to upload image on application server and display it .right now i am able to store image in aaplication server but it is in binary format how to make it display ?
i am using following methd to store image on application server.
DATA lv_filename TYPE string.
OPEN DATASET lv_filename FOR OUTPUT IN BINARY MODE.
LOOP AT lt_solix_tab INTO ls_solix.
TRANSFER ls_solix TO lv_filename.
ENDLOOP.
Hi Sumeety,
Get the x string content from the applicaton server & using any action display it.
Code like below.
DATA content TYPE xstring.
DATA mimetype TYPE string.
DATA ev_mime_type TYPE MIMETYPES-TYPE.
DATA filename TYPE string.
OPEN DATASET lv_filename FOR INPUT IN BINARY MODE.
READ DATASET lv_filename INTO content.
CLOSE DATASET lv_filename.
" get mime type for file type
DATA lv_file_name TYPE c.
lv_file_name = lv_filename.
CALL FUNCTION 'SDOK_MIMETYPE_GET'
EXPORTING
extension = lv_file_name
IMPORTING
MIMETYPE = ev_mime_type.
mimetype = ev_mime_type.
CALL METHOD cl_wd_runtime_services=>attach_file_to_response
EXPORTING
i_filename = filename
i_content = content
i_mime_type = mimetype
* i_in_new_window = ABAP_FALSE
* i_inplace = ABAP_FALSE
.
But this will open the image separately from you application & u can download it in your desktop.
If you want to use it in your application & display it inside your view then upload the image as MIME object in your web dynpro component.
Reply in case of any issue.
Regards,
Monishankar Chatterjee
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.