CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2004
    Posts
    170

    [RESOLVED] download file and refresh page

    Hi,
    Can anybody help me to solve following problem:
    I have jsp page with the button and status.
    1. User presses the button
    2. System outputs file for user.
    3. User saves file.
    4. System starts to refresh page to change status.

    Now I know how to output file to user:
    Code:
     
    private void output(String fileName, String content, HttpServletResponse response)
    throws IOException
    {
    response.setContentType("application/x-file-download");
    response.setHeader("Content-disposition", "attachment; filename=" + fileName);
    ServletOutputStream outputStream = response.getOutputStream();
    outputStream.print(content);
    outputStream.flush();
    outputStream.close();
    }
    But I can't understand how to also refresh page.

  2. #2
    Join Date
    Jun 2004
    Posts
    170

    Re: download file and refresh page

    Solved it this way:

    1.user press button
    2.On server program check current status and if it has to be changed, programme change it,set a flag and send responce.
    3.In jsp if flag is set, javascript submit form ones more.
    4.In responce program send file, like I show early.

    Thanks everyone.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured