StageWebViewDisk打破iPad上的文件上传(IOS?) [英] StageWebViewDisk Breaks the File Upload on iPad (iOS?)

查看:271
本文介绍了StageWebViewDisk打破iPad上的文件上传(IOS?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的Adobe空气为iPad / iPhone应用程序。

I'm using Adobe Air for iPad/iPhone application.

我还使用 StageWebViewBridge https://开头github.com/paleozogt/StageWebViewBridge 的)为主要web内容显示容器

I'm also using StageWebViewBridge (https://github.com/paleozogt/StageWebViewBridge) as the main web content displaying container.

我的应用程序非常适用于桌面版,但 StageWebViewBridge StageWebViewDisk 打破HTML文件上传功能:

My application works well for the Desktop version, but the StageWebViewBridge's StageWebViewDisk breaks HTML File Uploading feature:

<input id="user_avatar" name="user[avatar]" style="width:100%" type="file" />

也就是说,当文件浏览,并从任拍照或视频选择现有的选择从现实iPad设备,上述 user_avatar 输入没有得到所有更新。

i.e., whenever a file is browsed and selected from either Take Photo or Video or Choose Existing from the real iPad device, the above user_avatar input does NOT get updated at all.

我认为一些路径是搞砸了由 StageWebViewDisk.initialize(级)

I believe some paths are messed up by StageWebViewDisk.initialize(stage).

您可以找到完整的源代码 StageWebViewDisk 在这里: <一href="https://github.com/paleozogt/StageWebViewBridge/blob/master/StageWebViewBridge/src/es/xperiments/media/StageWebViewDisk.as" rel="nofollow">https://github.com/paleozogt/StageWebViewBridge/blob/master/StageWebViewBridge/src/es/xperiments/media/StageWebViewDisk.as

You can find the full source of StageWebViewDisk here: https://github.com/paleozogt/StageWebViewBridge/blob/master/StageWebViewBridge/src/es/xperiments/media/StageWebViewDisk.as

和以下code段是非常可疑的:

And the following code snippet is very suspicious:

case isIPHONE :
    /* new iOS 5.0 Data Storage Guidelines
     * https://developer.apple.com/icloud/documentation/data-storage/
     * https://developer.apple.com/library/ios/#qa/qa1719/_index.html
     */
    _appCacheFile = new File(File.applicationDirectory.nativePath +"/\.\./Library/Caches");

    _applicationCacheDirectory = new File( _appCacheFile.nativePath ).url;
    _applicationRootPath = _applicationCacheDirectory + '/' + getWorkingDir();
    _applicationSourcesDirectory = new File( new File( "app:/" + _document_root ).nativePath ).url;
    _appDocsDirectory = File.documentsDirectory.url;

    /* new iOS 5.0 Data Storage Guidelines
     * https://developer.apple.com/icloud/documentation/data-storage/
     * https://developer.apple.com/library/ios/#qa/qa1719/_index.html
     */                 
    _applicationTempDir = new File(File.applicationDirectory.nativePath +"/\.\./tmp");

    // To acomplish the Apple  Data Storage Guidelines Rules delete our TMP files dir at exit
    NativeApplication.nativeApplication.addEventListener(Event.EXITING, deleteTempFolder,false,0,true );
    NativeApplication.nativeApplication.addEventListener(Event.DEACTIVATE, deleteTempFolder, false, 0, true);                   

    break;

我调试了很多,我终于发现了 StageWebViewDisk.initialize(级)引起的问题。

的证明是,当我不使用 StageWebViewDisk.initialize(级),而是直接分配 StageWebViewBridge._view.stage ,它工作得很好。

The proof is that, when I don't use StageWebViewDisk.initialize(stage), instead, directly assign the stage to StageWebViewBridge._view.stage, it works very well.

我不熟悉的iOS应用程序/ cache目录。

I'm not familiar with the iOS app/cache directories.

请告诉我。

推荐答案

我终于想通了:

_applicationTempDir = new File(File.applicationDirectory.nativePath +"/\.\./SWVBTmp");
// It seems "tmp" is being used by the iOS system (such as the html file upload), so we changed to "SWVBTmp"; 

这篇关于StageWebViewDisk打破iPad上的文件上传(IOS?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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