cancel
Showing results for 
Search instead for 
Did you mean: 

ITS - upload/download of files - getting java error on download

Former Member
0 Kudos

Hi, I'm working on ITS to upload/download some files, really simple files in ASC and i use cl_gui_frontend_services=>gui_upload it works fine, and to download the cl_gui_frontend_services=>gui_download that in R/3 works but on the ITS give an error.

Any idea or someone that happend the same?

Thanks in advance to all

Regards

Jaime

View Entire Topic
Former Member
0 Kudos

Hai ,

u want to upload ur file here is code

<center>File upload test</center>

<br>

<table><tr>

<form method="post" enctype="multipart/form-data" action="http://your_host/servlet/UploadServlet?your_config">

<td> <input type="file" size=20 name="fname"> </td>

<td> <input type="Submit" value="Upload"> </td> </form>

</tr></table>

For download

<%

String myFileName = request.getParameter("fileName");

response.setContentType("application/octet-stream");

response.setHeader("Content-Disposition", "attachment; filename=\"" + myFileName + "\"");

String root = "D:/";

InputStream in = null;

ServletOutputStream outs = response.getOutputStream();

try {

in = new BufferedInputStream

(new FileInputStream(root + myFileName));

int ch;

while ((ch = in.read()) != -1) {

outs.print((char) ch);

}

}

finally {

if (in != null) in.close(); // very important

}

outs.flush();

outs.close();

in.close();

%>

try this u can get it .

Regards ,

venkat .

Former Member
0 Kudos

Hi, thanks for the javascript code but its running on sap gui html.

Regards

Jaime

Former Member
0 Kudos

Hi ,

Exactly what error ur getting for download file .

i think even for java sap GUI The code java script is same right ,

let me elaborate ur error problem,

Regards ,

venkat

thorsten_domsalla
Active Participant
0 Kudos

Hello Venkat,

I don't understand your coding likewise. There is nothing about the SAP GUI for HTML. As I understand it Jaime uses ABAP to download a file via Webgui. No Java, no user specific Javascript as far as I understand the topic.

Best regards,

TJ