选择要上传的文件会导致移动Safari崩溃 [英] Selecting a file to upload causes mobile Safari to crash

查看:179
本文介绍了选择要上传的文件会导致移动Safari崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用< input type =file> 来让用户上传一个至少是我的iPhone 6 Plus的行为image

< div class =add__from-camera> < button class =add__from-camera__btn> < i class =fa fa-fw fa-camera>< / i>用相机添加< /按钮> < input class =add__from-camera__inputtype =file>< / div>



这个休息事件导致该选项卡在大约50%的时间内崩溃,在我的应用程序中大约有90%的时间出现。

>当我发现错误时,我很幸运地让所有的Safari崩溃了,这是日志的一部分:

 异常类型:EXC_BAD_ACCESS(SIGSEGV)
异常子类型:KERN_INVALID_ADDRESS 0x00030000006467ba
触发线程:0

线程0名称:调度队列:com.apple.main-thread
线程0崩溃:
0 WebKit 0x000000018a48566c WebKit :: WebPageProxy :: didChooseFilesForOpenPanelWithDisplayStringAndIcon(WTF :: Vector< WTF :: String,0ul,WTF :: CrashOnOverflow> const&;,WTF :: String const& amp; API :: Data const *)+ 44
1 WebKit 0x000000018a461648 WebKit :: WebOpenPanelResultListenerProxy :: chooseFiles(API :: Array *,API :: String *,API ::数据常量*)+ 100
2 WebKit 0x000000018a461648 WebKit :: WebOpenPanelResultListenerProxy :: chooseFiles(API :: Array *,API :: String *,API :: Data const *)+ 100
3 WebKit 0x000000018a413020 - [WKFileUploadPanel _chooseFiles:displayString:iconImage:] + 468

它似乎表示一个(overflow?)错误在显示小缩略图预览?有没有一种方法可以防止Safari在使用文件输入时崩溃,或者至少不会呈现缩略图预览? 解决方案

试试这个:

 < input class =add__from-camera__inputtype =fileaccept =image / *; capture =相机> 


I've been experiencing behaviour on, at least my iPhone 6 Plus, when using the <input type="file"> to let the user upload an image.

<div class="add__from-camera">
    <button class="add__from-camera__btn">
        <i class="fa fa-fw fa-camera"></i> Add with Camera
    </button>
    <input class="add__from-camera__input" type="file">
</div>

This rest case results in crashes of the tab about 50% of the time, and in my app about 90% of the time.

I was 'lucky' enough to get all of Safari to crash once when the error happened, and this was part of the log:

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x00030000006467ba
Triggered by Thread:  0

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   WebKit                          0x000000018a48566c WebKit::WebPageProxy::didChooseFilesForOpenPanelWithDisplayStringAndIcon(WTF::Vector<WTF::String, 0ul, WTF::CrashOnOverflow> const&, WTF::String const&, API::Data const*) + 44
1   WebKit                          0x000000018a461648 WebKit::WebOpenPanelResultListenerProxy::chooseFiles(API::Array*, API::String*, API::Data const*) + 100
2   WebKit                          0x000000018a461648 WebKit::WebOpenPanelResultListenerProxy::chooseFiles(API::Array*, API::String*, API::Data const*) + 100
3   WebKit                          0x000000018a413020 -[WKFileUploadPanel _chooseFiles:displayString:iconImage:] + 468

It seems to indicate an (overflow?) error in display the little thumbnail preview? Is there a way to prevent Safari from crashing when using file input, or at least don't render the thumbnail preview?

解决方案

Try this:

<input class="add__from-camera__input" type="file" accept="image/*;capture=camera">

这篇关于选择要上传的文件会导致移动Safari崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆