I built a web application that uses the RE API to generate reports as
PDF files. The web application generates the report correctly but saves
it in another file.

I need the web application to ask the user for the location were to
download the file. However, when the user specifies the file name to
use and the desired location, the browser actually creates two files.
The file the user wants is created empty and the file with the actual
report contents is created in the home folder named as "report.pdf".

I'm using the following code to tell the browser to download the file as
an attachment:

On 6/2/2011 12:51 PM, msotomayor wrote:
> Hello:
>
> I built a web application that uses the RE API to generate reports as
> PDF files. The web application generates the report correctly but saves
> it in another file.
>
> I need the web application to ask the user for the location were to
> download the file. However, when the user specifies the file name to use
> and the desired location, the browser actually creates two files. The
> file the user wants is created empty and the file with the actual report
> contents is created in the home folder named as "report.pdf".
>
> I'm using the following code to tell the browser to download the file as
> an attachment:
>
> /*************************************/
>
> String headerValue =
> String.format( "attachment; filename=%s", reportFileName);
> response.setHeader( "Content-Disposition", headerValue );
> response.setContentType( "application/pdf" );
>
> /*************************************/
>
>
> I'm I missing something?
>
>
> Thanks,

What I really need is the browser to open the save as dialog without
displaying the contents of the report. If I comment that call, the
dialog is opened but the two files are created, the desired by the user
empty and another one called "report.pdf" with the actual contents.

Any other ideas?

On 06/02/2011 12:58 PM, Jason Weathersby wrote:
> I have done it like:
>
> resp.setContentType( "application/pdf" );
> resp.setHeader ("Content-Disposition","inline; filename=test.pdf");
>
>
> and in the PDFRenderOption I put:
>
> options.setOutputStream(resp.getOutputStream());
>
> Jason
>
> On 6/2/2011 12:51 PM, msotomayor wrote:
>> Hello:
>>
>> I built a web application that uses the RE API to generate reports as
>> PDF files. The web application generates the report correctly but saves
>> it in another file.
>>
>> I need the web application to ask the user for the location were to
>> download the file. However, when the user specifies the file name to use
>> and the desired location, the browser actually creates two files. The
>> file the user wants is created empty and the file with the actual report
>> contents is created in the home folder named as "report.pdf".
>>
>> I'm using the following code to tell the browser to download the file as
>> an attachment:
>>
>> /*************************************/
>>
>> String headerValue =
>> String.format( "attachment; filename=%s", reportFileName);
>> response.setHeader( "Content-Disposition", headerValue );
>> response.setContentType( "application/pdf" );
>>
>> /*************************************/
>>
>>
>> I'm I missing something?
>>
>>
>> Thanks,
>

Put that line back in ad change the content disposition to use attachment.
resp.setHeader("Content-disposition","attachment; filename=\""
+"test.pdf" +"\"");

Jason

On 6/2/2011 3:08 PM, msotomayor wrote:
> Hi Jason:
>
> Thank you for replying.
>
> That certainly works, but the call:
>
> > options.setOutputStream(resp.getOutputStream());
>
> causes the document to open within the browser.
>
>
> What I really need is the browser to open the save as dialog without
> displaying the contents of the report. If I comment that call, the
> dialog is opened but the two files are created, the desired by the user
> empty and another one called "report.pdf" with the actual contents.
>
>
> Any other ideas?
>
>
>
> On 06/02/2011 12:58 PM, Jason Weathersby wrote:
>> I have done it like:
>>
>> resp.setContentType( "application/pdf" );
>> resp.setHeader ("Content-Disposition","inline; filename=test.pdf");
>>
>>
>> and in the PDFRenderOption I put:
>>
>> options.setOutputStream(resp.getOutputStream());
>>
>> Jason
>>
>> On 6/2/2011 12:51 PM, msotomayor wrote:
>>> Hello:
>>>
>>> I built a web application that uses the RE API to generate reports as
>>> PDF files. The web application generates the report correctly but saves
>>> it in another file.
>>>
>>> I need the web application to ask the user for the location were to
>>> download the file. However, when the user specifies the file name to use
>>> and the desired location, the browser actually creates two files. The
>>> file the user wants is created empty and the file with the actual report
>>> contents is created in the home folder named as "report.pdf".
>>>
>>> I'm using the following code to tell the browser to download the file as
>>> an attachment:
>>>
>>> /*************************************/
>>>
>>> String headerValue =
>>> String.format( "attachment; filename=%s", reportFileName);
>>> response.setHeader( "Content-Disposition", headerValue );
>>> response.setContentType( "application/pdf" );
>>>
>>> /*************************************/
>>>
>>>
>>> I'm I missing something?
>>>
>>>
>>> Thanks,
>>
>

On 06/02/2011 04:18 PM, Jason Weathersby wrote:
> Put that line back in ad change the content disposition to use attachment.
> resp.setHeader("Content-disposition","attachment; filename=\""
> +"test.pdf" +"\"");
>
> Jason
>
> On 6/2/2011 3:08 PM, msotomayor wrote:
>> Hi Jason:
>>
>> Thank you for replying.
>>
>> That certainly works, but the call:
>>
>> > options.setOutputStream(resp.getOutputStream());
>>
>> causes the document to open within the browser.
>>
>>
>> What I really need is the browser to open the save as dialog without
>> displaying the contents of the report. If I comment that call, the
>> dialog is opened but the two files are created, the desired by the user
>> empty and another one called "report.pdf" with the actual contents.
>>
>>
>> Any other ideas?
>>
>>
>>
>> On 06/02/2011 12:58 PM, Jason Weathersby wrote:
>>> I have done it like:
>>>
>>> resp.setContentType( "application/pdf" );
>>> resp.setHeader ("Content-Disposition","inline; filename=test.pdf");
>>>
>>>
>>> and in the PDFRenderOption I put:
>>>
>>> options.setOutputStream(resp.getOutputStream());
>>>
>>> Jason
>>>
>>> On 6/2/2011 12:51 PM, msotomayor wrote:
>>>> Hello:
>>>>
>>>> I built a web application that uses the RE API to generate reports as
>>>> PDF files. The web application generates the report correctly but saves
>>>> it in another file.
>>>>
>>>> I need the web application to ask the user for the location were to
>>>> download the file. However, when the user specifies the file name to
>>>> use
>>>> and the desired location, the browser actually creates two files. The
>>>> file the user wants is created empty and the file with the actual
>>>> report
>>>> contents is created in the home folder named as "report.pdf".
>>>>
>>>> I'm using the following code to tell the browser to download the
>>>> file as
>>>> an attachment:
>>>>
>>>> /*************************************/
>>>>
>>>> String headerValue =
>>>> String.format( "attachment; filename=%s", reportFileName);
>>>> response.setHeader( "Content-Disposition", headerValue );
>>>> response.setContentType( "application/pdf" );
>>>>
>>>> /*************************************/
>>>>
>>>>
>>>> I'm I missing something?
>>>>
>>>>
>>>> Thanks,
>>>
>>
>

I just tried this and it worked for me. Where is it dropping the second
file?

Jason

On 6/2/2011 5:14 PM, msotomayor wrote:
> Thanks again, but it didn't worked neither.
>
> Should I use a ByteArrayOutputStream?
>
>
>
> On 06/02/2011 04:18 PM, Jason Weathersby wrote:
>> Put that line back in ad change the content disposition to use
>> attachment.
>> resp.setHeader("Content-disposition","attachment; filename=\""
>> +"test.pdf" +"\"");
>>
>> Jason
>>
>> On 6/2/2011 3:08 PM, msotomayor wrote:
>>> Hi Jason:
>>>
>>> Thank you for replying.
>>>
>>> That certainly works, but the call:
>>>
>>> > options.setOutputStream(resp.getOutputStream());
>>>
>>> causes the document to open within the browser.
>>>
>>>
>>> What I really need is the browser to open the save as dialog without
>>> displaying the contents of the report. If I comment that call, the
>>> dialog is opened but the two files are created, the desired by the user
>>> empty and another one called "report.pdf" with the actual contents.
>>>
>>>
>>> Any other ideas?
>>>
>>>
>>>
>>> On 06/02/2011 12:58 PM, Jason Weathersby wrote:
>>>> I have done it like:
>>>>
>>>> resp.setContentType( "application/pdf" );
>>>> resp.setHeader ("Content-Disposition","inline; filename=test.pdf");
>>>>
>>>>
>>>> and in the PDFRenderOption I put:
>>>>
>>>> options.setOutputStream(resp.getOutputStream());
>>>>
>>>> Jason
>>>>
>>>> On 6/2/2011 12:51 PM, msotomayor wrote:
>>>>> Hello:
>>>>>
>>>>> I built a web application that uses the RE API to generate reports as
>>>>> PDF files. The web application generates the report correctly but
>>>>> saves
>>>>> it in another file.
>>>>>
>>>>> I need the web application to ask the user for the location were to
>>>>> download the file. However, when the user specifies the file name to
>>>>> use
>>>>> and the desired location, the browser actually creates two files. The
>>>>> file the user wants is created empty and the file with the actual
>>>>> report
>>>>> contents is created in the home folder named as "report.pdf".
>>>>>
>>>>> I'm using the following code to tell the browser to download the
>>>>> file as
>>>>> an attachment:
>>>>>
>>>>> /*************************************/
>>>>>
>>>>> String headerValue =
>>>>> String.format( "attachment; filename=%s", reportFileName);
>>>>> response.setHeader( "Content-Disposition", headerValue );
>>>>> response.setContentType( "application/pdf" );
>>>>>
>>>>> /*************************************/
>>>>>
>>>>>
>>>>> I'm I missing something?
>>>>>
>>>>>
>>>>> Thanks,
>>>>
>>>
>>
>

The second file (which contains the actual contents of the report) is
automatically named as "report.pdf" and is dropped at the user's home
folder. I noticed that this file is created before the one that the
user specifies in the save as dialog.

On 06/03/2011 09:04 AM, Jason Weathersby wrote:
> I just tried this and it worked for me. Where is it dropping the second
> file?
>
> Jason
>
> On 6/2/2011 5:14 PM, msotomayor wrote:
>> Thanks again, but it didn't worked neither.
>>
>> Should I use a ByteArrayOutputStream?
>>
>>
>>
>> On 06/02/2011 04:18 PM, Jason Weathersby wrote:
>>> Put that line back in ad change the content disposition to use
>>> attachment.
>>> resp.setHeader("Content-disposition","attachment; filename=\""
>>> +"test.pdf" +"\"");
>>>
>>> Jason
>>>
>>> On 6/2/2011 3:08 PM, msotomayor wrote:
>>>> Hi Jason:
>>>>
>>>> Thank you for replying.
>>>>
>>>> That certainly works, but the call:
>>>>
>>>> > options.setOutputStream(resp.getOutputStream());
>>>>
>>>> causes the document to open within the browser.
>>>>
>>>>
>>>> What I really need is the browser to open the save as dialog without
>>>> displaying the contents of the report. If I comment that call, the
>>>> dialog is opened but the two files are created, the desired by the user
>>>> empty and another one called "report.pdf" with the actual contents.
>>>>
>>>>
>>>> Any other ideas?
>>>>
>>>>
>>>>
>>>> On 06/02/2011 12:58 PM, Jason Weathersby wrote:
>>>>> I have done it like:
>>>>>
>>>>> resp.setContentType( "application/pdf" );
>>>>> resp.setHeader ("Content-Disposition","inline; filename=test.pdf");
>>>>>
>>>>>
>>>>> and in the PDFRenderOption I put:
>>>>>
>>>>> options.setOutputStream(resp.getOutputStream());
>>>>>
>>>>> Jason
>>>>>
>>>>> On 6/2/2011 12:51 PM, msotomayor wrote:
>>>>>> Hello:
>>>>>>
>>>>>> I built a web application that uses the RE API to generate reports as
>>>>>> PDF files. The web application generates the report correctly but
>>>>>> saves
>>>>>> it in another file.
>>>>>>
>>>>>> I need the web application to ask the user for the location were to
>>>>>> download the file. However, when the user specifies the file name to
>>>>>> use
>>>>>> and the desired location, the browser actually creates two files. The
>>>>>> file the user wants is created empty and the file with the actual
>>>>>> report
>>>>>> contents is created in the home folder named as "report.pdf".
>>>>>>
>>>>>> I'm using the following code to tell the browser to download the
>>>>>> file as
>>>>>> an attachment:
>>>>>>
>>>>>> /*************************************/
>>>>>>
>>>>>> String headerValue =
>>>>>> String.format( "attachment; filename=%s", reportFileName);
>>>>>> response.setHeader( "Content-Disposition", headerValue );
>>>>>> response.setContentType( "application/pdf" );
>>>>>>
>>>>>> /*************************************/
>>>>>>
>>>>>>
>>>>>> I'm I missing something?
>>>>>>
>>>>>>
>>>>>> Thanks,
>>>>>
>>>>
>>>
>>
>

The file gets created even if you use this line?
options.setOutputStream(resp.getOutputStream());

Jason

On 6/3/2011 11:31 AM, msotomayor wrote:
> The second file (which contains the actual contents of the report) is
> automatically named as "report.pdf" and is dropped at the user's home
> folder. I noticed that this file is created before the one that the user
> specifies in the save as dialog.
>
>
> On 06/03/2011 09:04 AM, Jason Weathersby wrote:
>> I just tried this and it worked for me. Where is it dropping the second
>> file?
>>
>> Jason
>>
>> On 6/2/2011 5:14 PM, msotomayor wrote:
>>> Thanks again, but it didn't worked neither.
>>>
>>> Should I use a ByteArrayOutputStream?
>>>
>>>
>>>
>>> On 06/02/2011 04:18 PM, Jason Weathersby wrote:
>>>> Put that line back in ad change the content disposition to use
>>>> attachment.
>>>> resp.setHeader("Content-disposition","attachment; filename=\""
>>>> +"test.pdf" +"\"");
>>>>
>>>> Jason
>>>>
>>>> On 6/2/2011 3:08 PM, msotomayor wrote:
>>>>> Hi Jason:
>>>>>
>>>>> Thank you for replying.
>>>>>
>>>>> That certainly works, but the call:
>>>>>
>>>>> > options.setOutputStream(resp.getOutputStream());
>>>>>
>>>>> causes the document to open within the browser.
>>>>>
>>>>>
>>>>> What I really need is the browser to open the save as dialog without
>>>>> displaying the contents of the report. If I comment that call, the
>>>>> dialog is opened but the two files are created, the desired by the
>>>>> user
>>>>> empty and another one called "report.pdf" with the actual contents.
>>>>>
>>>>>
>>>>> Any other ideas?
>>>>>
>>>>>
>>>>>
>>>>> On 06/02/2011 12:58 PM, Jason Weathersby wrote:
>>>>>> I have done it like:
>>>>>>
>>>>>> resp.setContentType( "application/pdf" );
>>>>>> resp.setHeader ("Content-Disposition","inline; filename=test.pdf");
>>>>>>
>>>>>>
>>>>>> and in the PDFRenderOption I put:
>>>>>>
>>>>>> options.setOutputStream(resp.getOutputStream());
>>>>>>
>>>>>> Jason
>>>>>>
>>>>>> On 6/2/2011 12:51 PM, msotomayor wrote:
>>>>>>> Hello:
>>>>>>>
>>>>>>> I built a web application that uses the RE API to generate
>>>>>>> reports as
>>>>>>> PDF files. The web application generates the report correctly but
>>>>>>> saves
>>>>>>> it in another file.
>>>>>>>
>>>>>>> I need the web application to ask the user for the location were to
>>>>>>> download the file. However, when the user specifies the file name to
>>>>>>> use
>>>>>>> and the desired location, the browser actually creates two files.
>>>>>>> The
>>>>>>> file the user wants is created empty and the file with the actual
>>>>>>> report
>>>>>>> contents is created in the home folder named as "report.pdf".
>>>>>>>
>>>>>>> I'm using the following code to tell the browser to download the
>>>>>>> file as
>>>>>>> an attachment:
>>>>>>>
>>>>>>> /*************************************/
>>>>>>>
>>>>>>> String headerValue =
>>>>>>> String.format( "attachment; filename=%s", reportFileName);
>>>>>>> response.setHeader( "Content-Disposition", headerValue );
>>>>>>> response.setContentType( "application/pdf" );
>>>>>>>
>>>>>>> /*************************************/
>>>>>>>
>>>>>>>
>>>>>>> I'm I missing something?
>>>>>>>
>>>>>>>
>>>>>>> Thanks,
>>>>>>
>>>>>
>>>>
>>>
>>
>

BTW, the code is part of a Spring MVC webapp ran by Tomcat. I was
testing the code with Google Chrome and Firefox on Linux Fedora 14 with
the acroread package installed.

Hope this can help somebody. Thank you very much for your help!

On 06/03/2011 11:46 AM, Jason Weathersby wrote:
> The file gets created even if you use this line?
> options.setOutputStream(resp.getOutputStream());
>
> Jason
>
> On 6/3/2011 11:31 AM, msotomayor wrote:
>> The second file (which contains the actual contents of the report) is
>> automatically named as "report.pdf" and is dropped at the user's home
>> folder. I noticed that this file is created before the one that the user
>> specifies in the save as dialog.
>>
>>
>> On 06/03/2011 09:04 AM, Jason Weathersby wrote:
>>> I just tried this and it worked for me. Where is it dropping the second
>>> file?
>>>
>>> Jason
>>>
>>> On 6/2/2011 5:14 PM, msotomayor wrote:
>>>> Thanks again, but it didn't worked neither.
>>>>
>>>> Should I use a ByteArrayOutputStream?
>>>>
>>>>
>>>>
>>>> On 06/02/2011 04:18 PM, Jason Weathersby wrote:
>>>>> Put that line back in ad change the content disposition to use
>>>>> attachment.
>>>>> resp.setHeader("Content-disposition","attachment; filename=\""
>>>>> +"test.pdf" +"\"");
>>>>>
>>>>> Jason
>>>>>
>>>>> On 6/2/2011 3:08 PM, msotomayor wrote:
>>>>>> Hi Jason:
>>>>>>
>>>>>> Thank you for replying.
>>>>>>
>>>>>> That certainly works, but the call:
>>>>>>
>>>>>> > options.setOutputStream(resp.getOutputStream());
>>>>>>
>>>>>> causes the document to open within the browser.
>>>>>>
>>>>>>
>>>>>> What I really need is the browser to open the save as dialog without
>>>>>> displaying the contents of the report. If I comment that call, the
>>>>>> dialog is opened but the two files are created, the desired by the
>>>>>> user
>>>>>> empty and another one called "report.pdf" with the actual contents.
>>>>>>
>>>>>>
>>>>>> Any other ideas?
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 06/02/2011 12:58 PM, Jason Weathersby wrote:
>>>>>>> I have done it like:
>>>>>>>
>>>>>>> resp.setContentType( "application/pdf" );
>>>>>>> resp.setHeader ("Content-Disposition","inline; filename=test.pdf");
>>>>>>>
>>>>>>>
>>>>>>> and in the PDFRenderOption I put:
>>>>>>>
>>>>>>> options.setOutputStream(resp.getOutputStream());
>>>>>>>
>>>>>>> Jason
>>>>>>>
>>>>>>> On 6/2/2011 12:51 PM, msotomayor wrote:
>>>>>>>> Hello:
>>>>>>>>
>>>>>>>> I built a web application that uses the RE API to generate
>>>>>>>> reports as
>>>>>>>> PDF files. The web application generates the report correctly but
>>>>>>>> saves
>>>>>>>> it in another file.
>>>>>>>>
>>>>>>>> I need the web application to ask the user for the location were to
>>>>>>>> download the file. However, when the user specifies the file
>>>>>>>> name to
>>>>>>>> use
>>>>>>>> and the desired location, the browser actually creates two files.
>>>>>>>> The
>>>>>>>> file the user wants is created empty and the file with the actual
>>>>>>>> report
>>>>>>>> contents is created in the home folder named as "report.pdf".
>>>>>>>>
>>>>>>>> I'm using the following code to tell the browser to download the
>>>>>>>> file as
>>>>>>>> an attachment:
>>>>>>>>
>>>>>>>> /*************************************/
>>>>>>>>
>>>>>>>> String headerValue =
>>>>>>>> String.format( "attachment; filename=%s", reportFileName);
>>>>>>>> response.setHeader( "Content-Disposition", headerValue );
>>>>>>>> response.setContentType( "application/pdf" );
>>>>>>>>
>>>>>>>> /*************************************/
>>>>>>>>
>>>>>>>>
>>>>>>>> I'm I missing something?
>>>>>>>>
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>

On 6/3/2011 3:51 PM, ms wrote:
>
> I found the solution. The HttpServletResponse headers MUST be set before
> setting the render options not the opposite.
>
> This is what I have now. I commented some observations along the code.
>
> /*********************************************************************/
>
> response.setContentType( mimeType );
> String headerValue = "attachment; filename=" + reportFileName;
> response.setHeader( "Content-Disposition", headerValue );
>
> ..
> ..
> ..
>
> IRenderOption renderOption = new PDFRenderOption();
> renderOption.setOutputFormat( IRenderOption.OUTPUT_FORMAT_PDF );
> renderOption.setSupportedImageFormats( "JPG;PNG;BMP;SVG;GIF" );
> renderOption.setOutputStream( response.getOutputStream() );
>
> // * Downloads file automatically
> // renderOption.setOutputFileName( reportFileName );
>
> task.setRenderOption( renderOption );
> task.run();
>
> /*********************************************************************/
>
>
> BTW, the code is part of a Spring MVC webapp ran by Tomcat. I was
> testing the code with Google Chrome and Firefox on Linux Fedora 14 with
> the acroread package installed.
>
>
> Hope this can help somebody. Thank you very much for your help!
>
>
>
> On 06/03/2011 11:46 AM, Jason Weathersby wrote:
>> The file gets created even if you use this line?
>> options.setOutputStream(resp.getOutputStream());
>>
>> Jason
>>
>> On 6/3/2011 11:31 AM, msotomayor wrote:
>>> The second file (which contains the actual contents of the report) is
>>> automatically named as "report.pdf" and is dropped at the user's home
>>> folder. I noticed that this file is created before the one that the user
>>> specifies in the save as dialog.
>>>
>>>
>>> On 06/03/2011 09:04 AM, Jason Weathersby wrote:
>>>> I just tried this and it worked for me. Where is it dropping the second
>>>> file?
>>>>
>>>> Jason
>>>>
>>>> On 6/2/2011 5:14 PM, msotomayor wrote:
>>>>> Thanks again, but it didn't worked neither.
>>>>>
>>>>> Should I use a ByteArrayOutputStream?
>>>>>
>>>>>
>>>>>
>>>>> On 06/02/2011 04:18 PM, Jason Weathersby wrote:
>>>>>> Put that line back in ad change the content disposition to use
>>>>>> attachment.
>>>>>> resp.setHeader("Content-disposition","attachment; filename=\""
>>>>>> +"test.pdf" +"\"");
>>>>>>
>>>>>> Jason
>>>>>>
>>>>>> On 6/2/2011 3:08 PM, msotomayor wrote:
>>>>>>> Hi Jason:
>>>>>>>
>>>>>>> Thank you for replying.
>>>>>>>
>>>>>>> That certainly works, but the call:
>>>>>>>
>>>>>>> > options.setOutputStream(resp.getOutputStream());
>>>>>>>
>>>>>>> causes the document to open within the browser.
>>>>>>>
>>>>>>>
>>>>>>> What I really need is the browser to open the save as dialog without
>>>>>>> displaying the contents of the report. If I comment that call, the
>>>>>>> dialog is opened but the two files are created, the desired by the
>>>>>>> user
>>>>>>> empty and another one called "report.pdf" with the actual contents.
>>>>>>>
>>>>>>>
>>>>>>> Any other ideas?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On 06/02/2011 12:58 PM, Jason Weathersby wrote:
>>>>>>>> I have done it like:
>>>>>>>>
>>>>>>>> resp.setContentType( "application/pdf" );
>>>>>>>> resp.setHeader ("Content-Disposition","inline; filename=test.pdf");
>>>>>>>>
>>>>>>>>
>>>>>>>> and in the PDFRenderOption I put:
>>>>>>>>
>>>>>>>> options.setOutputStream(resp.getOutputStream());
>>>>>>>>
>>>>>>>> Jason
>>>>>>>>
>>>>>>>> On 6/2/2011 12:51 PM, msotomayor wrote:
>>>>>>>>> Hello:
>>>>>>>>>
>>>>>>>>> I built a web application that uses the RE API to generate
>>>>>>>>> reports as
>>>>>>>>> PDF files. The web application generates the report correctly but
>>>>>>>>> saves
>>>>>>>>> it in another file.
>>>>>>>>>
>>>>>>>>> I need the web application to ask the user for the location
>>>>>>>>> were to
>>>>>>>>> download the file. However, when the user specifies the file
>>>>>>>>> name to
>>>>>>>>> use
>>>>>>>>> and the desired location, the browser actually creates two files.
>>>>>>>>> The
>>>>>>>>> file the user wants is created empty and the file with the actual
>>>>>>>>> report
>>>>>>>>> contents is created in the home folder named as "report.pdf".
>>>>>>>>>
>>>>>>>>> I'm using the following code to tell the browser to download the
>>>>>>>>> file as
>>>>>>>>> an attachment:
>>>>>>>>>
>>>>>>>>> /*************************************/
>>>>>>>>>
>>>>>>>>> String headerValue =
>>>>>>>>> String.format( "attachment; filename=%s", reportFileName);
>>>>>>>>> response.setHeader( "Content-Disposition", headerValue );
>>>>>>>>> response.setContentType( "application/pdf" );
>>>>>>>>>
>>>>>>>>> /*************************************/
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> I'm I missing something?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>