Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Problem sending file with CL_HTTP_CLIENT


There is a legal requirement in my country, in which is necessary to send a TXT file to a government’s website.

This website gives a response with a XML file.

I should send the TXT file with a HTML FORM, this form has 3 parameters ( user, pass, file path+name ) and is sending data through "POST" method using encoding type "multipart".


<FORM action="" enctype="multipart/form-data" method="POST" name="form"> 
    <P><LABEL for="user">User: </LABEL>
    <input type="text" name="user" value="" /><BR/>
    <LABEL for="pass">Pass: </LABEL>
    <input type="password" name="password" value="" /></P>
    <input type="file" name="file" value="" /><BR/>
    <input type="submit" />

I was working with a container and class CL_GUI_HTML_VIEWER and can send the file successfully, but in this way, i can’t read and process XML response.

I was trying with an alternative way, using class CL_HTTP_CLIENT, with some problems: if I send a HTML FORM with only user and pass fields, works fine, but if I try to send a file, doesn't work.

any idea?

anyone can help me?

I have points to give!!!



Not what you were looking for? View more on this topic or Ask a question