on 04-21-2004 4:43 PM
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( ).
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.