-
Bug
-
Resolution: Fixed
-
Critical
-
2.5.5, 2.6.2, 2.8.6, 3.0
-
MOODLE_25_STABLE, MOODLE_26_STABLE, MOODLE_28_STABLE, MOODLE_30_STABLE
-
MOODLE_28_STABLE, MOODLE_29_STABLE
-
MDL-44828-master -
-
Team '; drop tables Sprint 9
Any resources that have force download enable are unable to be opened directly on an android device.
For example any pdf, gif or any file type stored in a "folder" resource is set to force download = true
if you try and download any of these files on an android device with chrome or the AOSP browser it downloads but when trying to open the file from the notification bar or download manager, you get the error "can't open file"
The file is not actually corrupted as if a file explorer is downloaded and the file is located and opened manually it still works.
This problem is due to the wrong mime type being sent with the file
The android download manager relies on the correct mime file type being sent to open the file.
This has been tested on multiple android devices, nexus 7 (2013) android 4.4 chrome v30 , sony xperia s android 4.1.2 chrome v30 and AOSP browser
In some other discussions/trackers/ it was mentioned this is intentional for XSS security purposes, but on android none of these file types open in the browser, they all open through download manager only. (tested .pdf, .gif, .html)
See existing discussions here:
https://tracker.moodle.org/browse/MDL-43764
https://tracker.moodle.org/browse/MDL-36917
also see: https://moodle.org/mod/forum/discuss.php?d=164712
A patch is provided in MDL-36917 which was abandoned, it patched /lib/filelib.php to enable mime type sending for android devices
I am proposing a modified version of this patch , However android browser detection also needs patching as it does not correctly detect androids default browser (chrome) after 4.1.2 - i will log this separately, patches to come
- has been marked as being related by
-
MDL-36917 PDF Download is not running on Android Web Browser.
- Closed
-
MDL-43764 Attachment files in Forum can't be open in mobile device (tested on Android, iOS)
- Closed
-
MDL-28501 For folder resource, allow files to be opened in the browser rather than being downloaded
- Closed
- will help resolve
-
MDL-38495 'application/octet-stream' as the default MIME type
- Closed