New issue
Advanced search Search tips

Issue 597914 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

[Chrome][M49][Android 6.0] Saved image via "REPLACE FILE" is not displayed in Photos app

Reported by seiyon.p...@gmail.com, Mar 25 2016

Issue description

Steps to reproduce the problem:
1. Launch Chrome
2. Load http://m.dcinside.com
3. Save any image from any post.
4. Save same image again and select "REPLACE FILE".

What is the expected behavior?
Saved image via "REPLACE FILE" should be displayed in Photos app.

What went wrong?
Saved image via "REPLACE FILE" is not displayed in Photos app.

Did this work before? No 

Chrome version: 49.0.2623.87  Channel: stable
OS Version: 6.0
Flash Version: Shockwave Flash 21.0 r0

It is also reproducible on M46.
 

Comment 1 Deleted

Attachment 1
    File name - remap mime type.png
    Description - 3rd party browser apps are remapping mime type

Attachment 2
    File name - 20160324_104833.mp4
    Description - Screen recording of reproducible steps
remap mime type.png
36.7 KB View Download
20160324_104833.zip.001
10.0 MB Download
20160324_104833.zip.002
10.0 MB Download
20160324_104833.zip.003
10.0 MB Download
20160324_104833.zip.004
10.0 MB Download
20160324_104833.zip.005
10.0 MB Download
20160324_104833.zip.006
10.0 MB Download
20160324_104833.zip.007
6.8 MB Download
The mime type of downloaded image is "application/octet-stream".
But many 3rd party browser apps remap "application/octet-stream" to "image/jpeg" like attachment "remap mime type.png".

And I find out remapGenericMimeType API and maybe Chrome can use similar function to solve this problem.

https://android.googlesource.com/platform/frameworks/base/+/marshmallow-mr1-release/core/java/android/webkit/MimeTypeMap.java#126

Could you consider remapping mime type to "imaage/jpeg"?

Thanks.
Cc: yfried...@chromium.org qin...@chromium.org
Components: UI>Browser>Downloads
Owner: tedc...@chromium.org
Status: Assigned (was: Unconfirmed)
Issue reproducible, tested on Nexus5X/6.0, chrome stable: 49.0.2623.105.

Logs @ http://go/chrome-androidlogs1/5/597914
Note: Issue frequency 3/5
Gentle reminder
Cc: tedc...@chromium.org
Owner: changwan@chromium.org
changwan@ or qinmin@ are better suited to investigate than I
Gentle reminder
Gentle reminder
Labels: Needs-Feedback
Sorry, but m.dcinside.com isn't accessible outside Korea. It seems that they block foreign IP addresses. Could you provide a more concrete, non-dcinside URL? Thanks.
It is reproducible at "https://weather.com".
The mime-type of downloaded image is "application/unknown".

Gentle reminder
Labels: -Needs-Feedback
Cc: -qin...@chromium.org changwan@chromium.org
Owner: qin...@chromium.org
Hmm... We call DownloadManager#addCompletedDownload() with the same mime type "application/octet-stream" whether it is replaced or newly created.
But forcing the value to "image/jpeg" in DownloadManagerService.java actually seems to fix the problem for the replaced scenario.

qinmin@, could you take a look? I'm not quite familiar with how mime types are propagated.
Project Member

Comment 22 by bugdroid1@chromium.org, Aug 22 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2f54b5c49b1fe73dd179ac34e81a3d2575ef8cb7

commit 2f54b5c49b1fe73dd179ac34e81a3d2575ef8cb7
Author: qinmin <qinmin@chromium.org>
Date: Mon Aug 22 22:10:45 2016

Fix an issue that android doesn't know how to open the download after completion

When downloading a file, the Mime type could be generic.
Chrome used to callremapGenericMimeType for downloads going through Android
DownloadManager.
It should do the same for downloads handled by Chrome's network stack.

BUG= 597914 

Review-Url: https://codereview.chromium.org/2261323002
Cr-Commit-Position: refs/heads/master@{#413550}

[modify] https://crrev.com/2f54b5c49b1fe73dd179ac34e81a3d2575ef8cb7/chrome/android/java/src/org/chromium/chrome/browser/download/ChromeDownloadDelegate.java
[modify] https://crrev.com/2f54b5c49b1fe73dd179ac34e81a3d2575ef8cb7/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerDelegate.java

Status: Fixed (was: Assigned)

Sign in to add a comment