Skip to Content
author's profile photo Former Member
Former Member

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

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 28, 2008 at 09:35 AM

    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 .

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 28, 2008 at 06:50 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 28, 2008 at 11:22 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 28, 2008 at 02:44 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.