cancel
Showing results for 
Search instead for 
Did you mean: 

Document Download: IE Prompts with Two Open or Save Dialog Boxes

CHRNIEMANN
Advisor
Advisor
0 Kudos

Hello!

I do download Documents (e.g. Excel) and want to provide the user always the option of opening in the related application or saving it.

I use content-disposition (attachment, not inline)

as http header field.

When opening (not saving) the Internet Explorer always prompts twice with the "save or open" dialog box.

Any idea?

Coding:

l_value = l_s_skwf_cpprp-mimetype.

runtime->server->response->set_header_field(

name = 'Content-Type' value = l_value ).

runtime->server->response->set_header_field(

name = 'cache-control' value = 'max-age=0' ).

runtime->server->response->delete_header_field(

name = 'Expires' ).

runtime->server->response->delete_header_field( name = 'Pragma' ).

concatenate 'attachment; filename=' l_docline-filename into l_value.

runtime->server->response->set_header_field( name = 'content-disposition' value = l_value ).

runtime->server->response->set_data(

data = file_content

length = l_file_length ).

navigation->response_complete( ).

Accepted Solutions (0)

Answers (1)

Answers (1)

CHRNIEMANN
Advisor
Advisor
0 Kudos

If You uncheck the checkbox "Always ask before opening this type of file" on the second dialog box, this will no more be asked for this file type.

The result can also be seen in the Windows Explorer

-> Menu "Folder Options"

-> "File Types"

-> "Advanced"

-> "Confirm open after download"

The checkbox will no more be checked for the file type.

It was just on my PC, that I was asked again and again although I uncheck the checkbox "Always ask before opening this type of file"...

I recommend on this the MS Knowledge Base articles

823057

238588

260519

In the code below the parameter "length" in the method "set_data" should not be set.

Good luck,

Christian Niemann