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

Accepted Solutions (1)

Accepted Solutions (1)

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

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi thzs to all, but my problem was very wierd to say less, i've change the browser to firefox and it work fine. So using IE7 and VISTA generated that problem.

Once again thanks for the time spend to all

Regards

Jaime

thorsten_domsalla
Active Participant
0 Kudos

Hello Jaime,

> So using IE7 and VISTA ...

Ah. Did you check the settings for the Java VM used in IE?

With best regards,

TJ

Former Member
0 Kudos

Hello Jaime,

in R/3 >= 640 there exist a test program istq_upload_download. There you can test the gui_download functionality in general.

Furthermore you can call transaction se24 with class cl_gui_frontend_services and test the method gui_download.

Does this work. Or do you use an older R/3?. What is the error. A java I/O error can be analysed in the java console.

Maybe the file path is not correct.

Best regards,

Ralf

thorsten_domsalla
Active Participant
0 Kudos

ITSQ_UPLOAD_DOWNLOAD

thorsten_domsalla
Active Participant
0 Kudos

Hello Jaime,

how exactly looks the error like? Is it a Javascript or a Java error? I am asking because most of the client code of the SAP GUI for HTML is based on Javascript. But for up- and download a Java applet is used.

I remember another questioner in this forum who asked for the Query.class that could not be found ...

With best regards,

TJ

Former Member
0 Kudos

Hi TJ,

it's a JAVA I/O error. The strange thong is that the upload is using the same java class and it works fine. Any idea?

Regards

Jaime