on 03-20-2024 6:11 PM
Hi there!
When uploading an html file with GUI_UPLOAD and filetype 'BIN' I get corrupt data like this:
à¨â„¼â´çŒ ç™¡æ‘¥æ˜ æ½²â牵㵬〨㌱⤲楦敬⼺⼯㩃唯敳ç²çœ¯æ¹©æ±«ç‰¥â½£ç䑰瑡⽡潌慣⽬æ¥ç‰£ç¯æ™¯â½´æ¥—æ‘®ç¯â½³ä¹‰ç‘¥æ…ƒæ¡£â½¥æ½ƒç‘®æ¹¥â¹´ç•æ±´æ½¯â½«ä•ã™å©Šå©åŒ¯ä¥å‘Žä½Ÿå……〰〲ㄷ㈳ㄸ㉟㈰〴㈲ㄸ㈴ãµâ¸·ç‘¨æ±â´ ã¸à¨æ ¼æµ´ã¹¬æ ¼æ…¥â¤æµ¸æ¹¬ã©³ç‘´âˆ½ç‘¨ç´â¼ºçœ¯ç·çŒ®ç¡æŒ®æµ¯ç¯æ…²ç®æ½¦æµ²ç‘¡æ½©âµ®æ•´ç慬整≳㰾æ•æ…´æ 瑴⵰煥極㵶䌢湯t 湥⵴祔数•潣瑮湥㵴ç¢ç¡¥â½´ç‘¨æ±â€»æ¡£ç‰¡æ•³ãµ
The file length is correct.
When uploading text files, I get chinese characters
瑥整牲楥敦Ɱ洠瑩搠牥䈠瑩整
Afterwards I use FM SO_DOCUMENT_INSERT_API1 to add the uploaded file to GOS.
It works with images and office files. but html and text files do not work.
I also tried different code pages (utf-8, utf-16) at GUI_UPLOAD w/o success.
Any ideas?
Thanks
~Enno
The problem seemed to be that because of the document type or file extension "TXT", the binary content was interpreted as "text" by simply copying the binary content table into the text content table.
I still do not know when or why this behaviour had changed.
This is an alternative to the process:
DATA(lo_gos_api) = cl_gos_api=>create_instance(
VALUE #(
instid = CONV #( p_myid )
typeid = 'MYTYPEID'
catid = 'BO' ) ).
DATA(ls_attcont) = VALUE gos_s_attcont(
atta_id = 'MYTYPEID'
atta_cat = cl_gos_api=>c_msg
cr_user = sy-uname
cr_name = space
cr_date = sy-datum
cr_time = sy-uzeit
filesize = filelength
filename = zcl_devt_file=>get_filename_from_path( p_file )
tech_type = zcl_devt_file=>get_extension_from_filename( p_file )
descr = p_descr
lang = sy-langu
content = space
content_x = cl_bcs_convert=>xtab_to_xstring( lt_contx ) ).
lo_gos_api->insert_al_item(
EXPORTING
is_attcont = ls_attcont
iv_roltype = cl_gos_api=>c_attachment
IMPORTING
ev_atta_id = DATA(ev_atta_id)
RECEIVING
rv_commit = DATA(commit_required) ).
IF commit_required = abap_true.
COMMIT WORK.
"file has been added.
MESSAGE i036 WITH p_bugid.
ENDIF.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
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.