on 05-26-2008 3:15 PM
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
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 .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.