Bug 277814 - Webdav isn't correctly identifying many filetypes
Summary: Webdav isn't correctly identifying many filetypes
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Unmaintained
Component: webdav (show other bugs)
Version: 4.6
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
: 154683 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-07-15 03:38 UTC by Kubuntiac
Modified: 2011-11-13 06:08 UTC (History)
1 user (show)

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


Attachments
A range of filetypes locally and over webdave via Dolphin (271.83 KB, image/png)
2011-07-15 03:38 UTC, Kubuntiac
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kubuntiac 2011-07-15 03:38:40 UTC
Created attachment 61887 [details]
A range of filetypes locally and over webdave via Dolphin

Version:           4.6 (using KDE 4.6.4) 
OS:                Linux

In dolphin, most files are corretly identified and their type can be seen in the statusbar by hovering over them. Clicking them opens the files in the correct app and right click "Open With..." shows a list of apps that are known to be able to handle this file type.

Many of these same files, on a webdav location just show up as type "Unkown", with an icon showing four squares. "Open With" suggests no apps that can open them. When opening any of these files (including .ods, .odt, .odp and others) in Calligra, the user is forced to manually tell the calligra app, what type of file it is.

Reproducible: Didn't try

Steps to Reproduce:
1. Create an .odt file ( Calligra Words / LibreOffice Word ) to a local directory. This can also be done with .ods,.odp,.doc,.exe,.xml,.php,.pl,.sql,.mp3,.wav and others.
2. Copy that file to a webdav location (I'm using an instance of OwnCloud).
3. Compare how the same file appears in Dolphin, in the two locations

Actual Results:  
Files shown in Dolphin through webdav are of a mimetype "Unknown", even with the correct file extension.

Expected Results:  
Filetypes are recognised when they are in a webdav location, just as they are when they are local, especially if they have an accurate extension identifying them
Comment 1 Dawit Alemayehu 2011-10-22 14:14:39 UTC
I am almost certain this is not a bug, but rather an implementation issue. That is the response that comes back from the server, in this case ownCloud, does not contain the correct Content-Type header. 

You can easily find this out whether or not the server is sending the correct content-type by following the instructions outlined in the link below to generate http debug output from the http ioslave and looking at the server's response:

http://techbase.kde.org/Development/Tutorials/Debugging/Debugging_IOSlaves#GUI
Comment 2 Dawit Alemayehu 2011-10-28 20:35:56 UTC
Git commit 0b810d76d3b4d55b97bf78c2ddb772a5ae13e7e1 by Dawit Alemayehu.
Committed on 28/10/2011 at 22:32.
Pushed by adawit into branch 'KDE/4.7'.

If a webdav resource is not a directory and the server did not specify its content-type,
attempt to guess the content-type from its name.

This fix depends on David's fix for KFileItem. See
http://commits.kde.org/kdelibs/7a0244bd796ffc52b4e6634fff25fc1366ef12a4

BUG: 277814
FIXED-IN: 4.7.4

M  +16   -1    kioslave/http/http.cpp

http://commits.kde.org/kdelibs/0b810d76d3b4d55b97bf78c2ddb772a5ae13e7e1
Comment 3 Dawit Alemayehu 2011-11-13 06:08:16 UTC
*** Bug 154683 has been marked as a duplicate of this bug. ***