Closed Bug 1906039 Opened 2 years ago Closed 1 year ago

The type information was lost during the file upload.

Categories

(Firefox for Android :: Browser Engine, defect)

Firefox 127
All
Android
defect

Tracking

()

RESOLVED FIXED
137 Branch
Tracking Status
firefox137 --- fixed

People

(Reporter: yjbrowserjyt, Assigned: m_kato)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:127.0) Gecko/20100101 Firefox/127.0

Steps to reproduce:

visit https://bsydbookandquestion2.eletell.com/#/Ebook?token=wm20FXAtd3RIVLnADIebbFfWoF7fGKUk

upload a epub file

Actual results:

This is the file format verification for this webpage. On Firefox, if the file is of type epub, the type is "".
beforeAvatarUploadFile: function (e) {
this.bookName = e.name.substr(0, e.name.lastIndexOf('.'));
var i = 'text/plain' === e.type,
n = 'application/pdf' === e.type,
t = 'application/epub+zip' === e.type ||
'application/epub' === e.type;
return i ? (
this.success = !0,
e.size > 8388608 ? (this.$message.error('上传文件过大单本书大小不能超过8MB'), !1) : i
) : n ? (
this.success = !0,
e.size > 8388608 ? (this.$message.error('上传文件过大单本书大小不能超过8MB'), !1) : n
) : t ? (
this.success = !0,
e.size > 8388608 ? (this.$message.error('上传文件过大单本书大小不能超过8MB'), !1) : t
) : (
this.success = !1,
this.$message.error('上传书籍文件只能是 TXT或EPUB 格式!'),
void this.fileList.pop()
)
}

Like :
{ uid: 1719988187281, name: "111.epub", lastModified: 1719988187236, size: 284325, type: "" }

Expected results:

I hope the website can correctly recognize the format and function properly.

The severity field is not set for this bug.
:royang, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(royang)

Hi :rsainani, ended up didn't triage this one. I'll move the NI to you. Thanks

Flags: needinfo?(royang) → needinfo?(rsainani)

Thanks for reporting this bug. I can reproduce this on Fenix 130.0 (release) and 132.0a1 (nightly).

Note that this works fine on Firefox Desktop and Chrome on Android.

Severity: -- → S2
Component: General → Browser Engine
Flags: needinfo?(rsainani)
Status: UNCONFIRMED → NEW
Ever confirmed: true

I guess that easy fix is that we add epub (mapping to application/epub+zip) to https://searchfox.org/mozilla-central/rev/345ec3c55ddda5f0ce37168f0644dcdcc4834409/uriloader/exthandler/nsExternalHelperAppService.cpp#517.

GeckoView's File picker uses File API, but I think that there is no way to set MIME type by it via JavaScript.

Assignee: nobody → m_kato

When selecting epub document by file picker, File.type doesn't set
epub's MIME type. So we should add this MIME type to entries list.

Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 137 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: