Skip to Content
0
Apr 21, 2004 at 03:43 PM

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

72 Views

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( ).