StageWebViewDisk中断iPad上的file upload(iOS?)
我正在使用Adobe Air for iPad / iPhone应用程序。
我也使用StageWebViewBridge
( https://github.com/paleozogt/StageWebViewBridge )作为主要的网页内容显示容器。
我的应用程序适用于桌面版本,但StageWebViewBridge
的StageWebViewDisk
打破了HTMLfile uploadfunction:
<input id="user_avatar" name="user[avatar]" style="width:100%" type="file" />
也就是说,无论何时从真实的iPad设备上浏览并selectTake Photo or Video
或Choose Existing
的文件,上述user_avatar
input都不会被更新。
我相信有些path被StageWebViewDisk.initialize(stage)
弄乱了。
您可以在这里findStageWebViewDisk
的完整源代码: https : //github.com/paleozogt/StageWebViewBridge/blob/master/StageWebViewBridge/src/es/xperiments/media/StageWebViewDisk.as
而下面的代码片段是非常可疑的:
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;
我debugging了很多,最后我发现StageWebViewDisk.initialize(stage)
引起了问题。
certificate是,当我不使用StageWebViewDisk.initialize(stage)
时,直接将stage
分配给StageWebViewBridge._view.stage
,效果非常好。
我不熟悉iOS应用程序/caching目录。
请build议我。
我终于想通了:
_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";