Bug 31662 - konqueror displays web pages with "content-disposition: attachment" inline
Summary: konqueror displays web pages with "content-disposition: attachment" inline
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: general (show other bugs)
Version: 2.2
Platform: openSUSE Linux
: NOR wishlist
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
: 55775 (view as bug list)
Depends on:
Blocks:
 
Reported: 2001-08-27 12:18 UTC by andrej
Modified: 2006-03-15 11:44 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description andrej 2001-08-27 12:16:40 UTC
(*** This bug was imported into bugs.kde.org ***)

Package:           konqueror
Version:           2.2 (using KDE 2.2.0 )
Severity:          wishlist
Installed from:    SuSE
Compiler:          gcc version 2.95.2 19991024 (release)
OS:                Linux (i686) release 2.4.0-4GB
OS/Compiler notes: 

Konqueror does not support the http header: Content-Disposition: attachment. I don't know if this is a standard or not but msie presents the user with a 'save file' window when this http header is present in the response of the webserver. This way you can present the user with a save link even for formats that are usually displayed by the browser (html text etc).

Thanks!
Andrej

(Submitted via bugs.kde.org)
(Called from KBugReport dialog)
Comment 1 Dawit Alemayehu 2001-08-31 04:14:29 UTC
On Monday 27 August 2001 08:16 andrej@redwood.nl wrote:
> Package: konqueror
> Version: 2.2 (using KDE 2.2.0 )
> Severity: wishlist
> Installed from:    SuSE
> Compiler:          gcc version 2.95.2 19991024 (release)
> OS:                Linux (i686) release 2.4.0-4GB
> OS/Compiler notes:
>
> Konqueror does not support the http header: Content-Disposition:
> attachment. I don't know if this is a standard or not but msie presents
> the user with a 'save file' window when this http header is present in the
> response of the webserver. This way you can present the user with a save
> link even for formats that are usually displayed by the browser (html
> text etc).
>
> Thanks!

Hi Andrej

We do support Content-Disposition.  If it does not work then it must be a
bug somewhere.  Do you have a link for a site where this happens ?

Regards
Dawit A.
Comment 2 andrej 2001-08-31 14:16:54 UTC
Dawit Alemayehu wrote:

> On Monday 27 August 2001 08:16 andrej@redwood.nl wrote:
> 
>>Package: konqueror
>>Version: 2.2 (using KDE 2.2.0 )
>>Severity: wishlist
>>Installed from:    SuSE
>>Compiler:          gcc version 2.95.2 19991024 (release)
>>OS:                Linux (i686) release 2.4.0-4GB
>>OS/Compiler notes:
>>
>>Konqueror does not support the http header: Content-Disposition:
>>attachment. I don't know if this is a standard or not but msie presents
>>the user with a 'save file' window when this http header is present in the
>>response of the webserver. This way you can present the user with a save
>>link even for formats that are usually displayed by the browser (html
>>text etc).
>>
>>Thanks!
>>
> 
> Hi Andrej
> 
> We do support Content-Disposition.  If it does not work then it must be a
> bug somewhere.  Do you have a link for a site where this happens ?
> 
> Regards
> Dawit A.
> 

Hi
The page is on our intranet so I can't give you a link. :-(
Here are the headers as displayed using lynx:

HTTP/1.0 200 OK
Content-Type: text/html; charset=ISO-8859-1
Cache-Control: no-store
Pragma: no-cache
Expires: Thu 01 Jan 1970 00:00:00 GMT
Content-Disposition: attachment
Servlet-Engine: Tomcat Web Server/3.2.2 (JSP 1.1; Servlet 2.2; Java 
1.3.0; Linux 2.4.0-4GB x86; java.vendor=IBM Corporation)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<snip>

Konqueror displays this page in the browser no save file window is
displayed.

Regards
Andrej
Comment 3 Dawit Alemayehu 2001-09-01 20:37:12 UTC
On Friday 31 August 2001 10:16 Andrej Koelewijn wrote:
> Dawit Alemayehu wrote:
> > On Monday 27 August 2001 08:16 andrej@redwood.nl wrote:
> >>Package: konqueror
> >>Version: 2.2 (using KDE 2.2.0 )
> >>Severity: wishlist
> >>Installed from:    SuSE
> >>Compiler:          gcc version 2.95.2 19991024 (release)
> >>OS:                Linux (i686) release 2.4.0-4GB
> >>OS/Compiler notes:
> >>
> >>Konqueror does not support the http header: Content-Disposition:
> >>attachment. I don't know if this is a standard or not but msie presents
> >>the user with a 'save file' window when this http header is present in
> >> the response of the webserver. This way you can present the user with a
> >> save link even for formats that are usually displayed by the browser
> >> (html text etc).
> >>
> >>Thanks!
> >
> > Hi Andrej
> >
> > We do support Content-Disposition.  If it does not work then it must be a
> > bug somewhere.  Do you have a link for a site where this happens ?
> >
> > Regards
> > Dawit A.
>
> Hi
> The page is on our intranet so I can't give you a link. :-(
> Here are the headers as displayed using lynx:
>
> HTTP/1.0 200 OK
> Content-Type: text/html; charset=ISO-8859-1
> Cache-Control: no-store
> Pragma: no-cache
> Expires: Thu 01 Jan 1970 00:00:00 GMT
> Content-Disposition: attachment
> Servlet-Engine: Tomcat Web Server/3.2.2 (JSP 1.1; Servlet 2.2; Java
> 1.3.0; Linux 2.4.0-4GB x86; java.vendor=IBM Corporation)
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
>
> <snip>
>
> Konqueror displays this page in the browser no save file window is
> displayed.
>
> Regards

Hi Andrej

Ehh... the file-name paramter is missing from the Content-Disposition field or did
you purposefully cut it out ?  Anyways I still have to check is whether or not we 
prompt the user with the "Save As" dialog for html content even when the Content
-Disposition: field is present.  That is probably what is causing this issue.

Regards
Dawit A.
Comment 4 daniele 2003-03-09 21:00:55 UTC
I confirm it doesn't work. 
It is quite a problem when you have binary data stored within a database: you can 
use the content-disposition header field to force a "save as/open with" window, and 
provide a name for the file to be saved/opened. 
Mozilla handles it correctly: it prompts just what I'd expect. 
Konqueror just ignores it, both with binary and plain text files: if I remove the header, 
it just behaves the same. 
I'm using mandrake cooker's kde 3.1. 
 
Daniele 
Comment 5 daniele 2003-03-09 21:17:06 UTC
Actually, it seems as the header is correctly interpreted, but not used: for example, I 
get this prompt for saving a file stored within the DB (I used an extension unknown 
to the system): 
 
Open "http://127.0.0.1/~...unti.php?paperId=7" (7_testfile.xcgh)? 
 
"7_testfile.xcgh" being the name I've forced via the header. 
 
Still, when I hit "save as", the displayed name is not "7_testfile.xcgh", but 
"visualizzaAppunti.php", which is the name of the script that set the header and 
extracted the contents of the file from the dbms. 
 
Anyhow, on known filetypes I should be prompted as well, while the default handler 
is silently used. 
 
Daniele 
 
 
 
 
Comment 6 Dawit Alemayehu 2003-03-09 22:42:27 UTC
*** Bug 55775 has been marked as a duplicate of this bug. ***
Comment 7 Dawit Alemayehu 2003-12-18 07:07:17 UTC
This bug has been fixed in the current CVS version. The content dispostion header is now properly used when you are prompted to save the file. Also for the most part you get prompted to open or save the file even if the file type is known with some exceptions, e.g. non-compressed text and image files.
Comment 8 Allan Sandfeld 2006-03-13 16:38:51 UTC
Actually this never worked correctly, and doesn't work at all now.
Comment 9 Allan Sandfeld 2006-03-15 11:44:04 UTC
SVN commit 518811 by carewolf:

Handle content-disposition: attachment in HTTP-headers. Regression
BUG: 31662
 


 M  +6 -3      kdebase/konqueror/konq_mainwindow.cc  
 M  +5 -4      kdebase/konqueror/konq_run.cc  
 M  +21 -12    kdelibs/kioslave/http/http.cc  
 M  +11 -4     kdelibs/kparts/browserrun.cpp  
 M  +16 -6     kdelibs/kparts/browserrun.h