[ https://issues.apache.org/jira/browse/CB-6146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13918379#comment-13918379
]
Ian Clelland commented on CB-6146:
----------------------------------
Hi [~farhadf],
I think that this may have been resolved with the latest (almost released) version of the
File plugin. As part of CB-5233, there were a number of fixes made to the handling of asset-library
URLs, and I believe that this was one of them.
Can you try with the dev version of file? (Or wait a day or two until v1.0.1 is published
to the plugin repository?)
> FileTransfer.upload does not support iOS asset library type of URL
> ------------------------------------------------------------------
>
> Key: CB-6146
> URL: https://issues.apache.org/jira/browse/CB-6146
> Project: Apache Cordova
> Issue Type: Bug
> Components: iOS
> Affects Versions: 3.3.0
> Environment: Macbook Air, 10.9
> Reporter: Farhad Farzaneh
> Assignee: Ian Clelland
>
> When picking an image from the camera roll and using a NATIVE_URL type, the url may be
something like: {{assets-library://asset/asset.PNG?id=CFDB9708-75A2-44A9-9092-FCE1DB471B30&ext=PNG}}.
When this is presented as the localURL to {{[CDVFileTransfer fileDataForUploadCommand:]}}
it recognizes the file system to be the asset library and tries to read the file from the
indicated URL using {{[CDVAssetLibraryFilesystem readFileAtURL:]}}. I'm not sure why this
method tries to pull back the path from the URL with
> {code}
> NSString *path = [self fileSystemPathForURL:localURL];
> {code}
> and then rebuild the URL from that path below (line 223). However, the returned path
is {{@"/asset.PNG"}}, which when used to retrieve the asset fails.
> If the line (CDVAssetLibraryFilesystem.m: 223)
> {code}
> [assetsLibrary assetForURL:[NSURL URLWithString:path] resultBlock:resultBlock failureBlock:failureBlock];
> {code}
> is changed for
> {code}
> [assetsLibrary assetForURL:localURL.url resultBlock:resultBlock failureBlock:failureBlock];
> {code}
> then the asset can be found. But of course this was done for a reason, so I imagine
my fix breaks something else...
>
--
This message was sent by Atlassian JIRA
(v6.2#6252)
|