cancel
Showing results for 
Search instead for 
Did you mean: 

filename problem when downloading a file from Kpro

Former Member
0 Kudos

Hello,

I'm trying to download a file from Kpro file server and the name of the file has 2 byte Korean character.

Here is the problem. When I download the file all the Korean letters in the filename is converted to underbar(_).

ex) original filename : 한글파일명abc.xls

downloaded filename : _____abc.xls

And this is the code.

-


lf_value = lf_mimetype.

pf_response->set_header_field( name = 'Content-Type'

value = lf_value ).

pf_response->delete_header_field( 'Cache-Control' ). "#EC NOTEXT

pf_response->delete_header_field( 'Expires' ). "#EC NOTEXT

pf_response->delete_header_field( 'Pragma' ). "#EC NOTEXT

lf_value = lf_filename.

CONCATENATE 'attachment; filename="' lf_filename '"' INTO lf_value.

pf_response->set_header_field( name = 'Content-Disposition'

value = lf_value ).

pf_response->set_data( lf_content ).

pf_navigation->response_complete( ).

-


Please help. Thank you.

Edited by: Ji Yeob Kim on May 7, 2009 1:06 PM

Edited by: Ji Yeob Kim on May 7, 2009 1:06 PM

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

cancelled

RieSe
Contributor
0 Kudos

Hi,

if you can acces the file from kpro, you have knowledge about the phio? Alright?

So place a call:


      object_fileproperty-class = 'DMS_PCD1'.
      object_fileproperty-objid =  _file-ph_objid.
      append object_fileproperty to object_fileproperties.

      call function 'SDOK_PHIOS_FILE_PROPERTIES_GET' destination object->remote
        tables
          object_fileproperties = object_fileproperties
          bad_objects           = bad_objects.

      read table object_fileproperties index 1 into object_fileproperty.

Best regards, Stefan

Former Member
0 Kudos

I didn't mean that. Sorry, my english is not so good

In the JAVA code below, I want to know how to make 'java.net.URLEncoder.encode(fileNm,"UTF-8")' in BSP.

-


response.reset() ;

response.setHeader("Content-Type", "doesn/matter;");

response.setHeader("Content-Disposition", "attachment;filename=" + java.net.URLEncoder.encode(fileNm,"UTF-8") + ";" );

response.setHeader("Content-Transfer-Encoding", "binary;");

response.setHeader("Content-Length", ""+file.length());

response.setHeader("Pragma", "no-cache;");

response.setHeader("Expires", "-1;");

-


Thank you.

athavanraja
Active Contributor
0 Kudos

you can use class cl_abap_conv_out_ce to encode the filename or try cl_http_utility class