Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9074335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:36:41+00:00 2026-06-16T18:36:41+00:00

On IBM Domino Server (version 8.5.3FP1 on Win32 platform) there are two web-agents, to

  • 0

On IBM Domino Server (version 8.5.3FP1 on Win32 platform) there are two web-agents, to generate PDF and RTF files by request.

Every agent generates RTF or PDF file in a temporary folder, then opens OutputStream instance to write this file to the client (browser, when save-file dialog appears).

All things work ok. Files are generated and saved correctly in temporary folder. But writing these files to OutputStream to let a user save it to the local disk, it does not work properly. Some files were written ok (small files, ~11Kb), but bigger files, ~34K were saved partially (sometimes 276 bytes saved, sometimes 4K bytes saved, etc).

I get OutputStream in my agents as follows:

final OutputStream os = this.getAgentOutputStream();

When file is generated and saved I use:

final FileInputStream fis = new FileInputStream(pdfFilePath);
IOUtils.copy(fis, os); // it is from Apache Commons IOUtils
fis.close();

Does not work.

Then I used this way instead:

final byte[] resultArray = FileUtils.readFileToByteArray(new File(pdfFilePath)); // result array has correct length and correct contents
os.write(resultArray);
os.flush();
os.close();

Does not work.

Then I used this way instead (tricky, but just for experimental purposes):

final byte[] resultArray = FileUtils.readFileToByteArray(new File(pdfFilePath)); // result array has correct length and correct contents
for (byte a:resultArray) {
    os.write(a);
}       

os.flush();
os.close();

Does. not. work.

Before sending data to output stream I have invoked:

java.io.PrintWriter pw = this.getAgentOutput();
pw.println("Content-type: application/pdf"); // also tried octet-stream, no effect
pw.println("Content-Disposition: attachment; filename=\"file.pdf\"");

And my question is as follows, folks. What is wrong with my approach? What I am doing wrong here? File is created and saved on server correctly. Output stream opened correctly, file read correctly. When I write to output stream there’s no exception. Output stream flushed and closed correctly.

What is wrong? I am trying to solve this the whole day, but I did not find a clue.

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T18:36:42+00:00Added an answer on June 16, 2026 at 6:36 pm

    Seems that Domino has bug with agent OutputStream. Stream obtained via agentRef.getAgentOutputStream(); does not work properly and performs partial write.

    Instead of using this way I decided to attach files to a NotesDocument instance, save it and provide user with link to attached files in this document.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using IBM Informix Dynamic Server Version 10.00.FC9 The error I'm getting is: 1226: Decimal
IBM Informix Dynamic Server Version 11.50.FC6 I am trying to execute a simple stored
IBM Informix Dynamic Server Version 11.50.FC6 I was working on a small stored procedure
Using IBM Informix Dynamic Server Version 10.00.FC9 I'm looking to set multiple field values
Server: IBM Informix Dynamic Server Version 11.70.FC1GE Client: IBM Data Server Driver package 5765-F41
Please see this IBM site - http://www.ibm.com/us/en/ If you see the site banners, there
When I go into ibm both in website and mobile I see two different
Are there some IBM ant tasks that support this?
I am using IBM Websphere Application Server v6 and Java 1.4 and am trying
Can a 7.5 ibm mq client dll run on MQ 6.x server (compatible with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.