[ 
https://issues.apache.org/jira/browse/CB-6146?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ian Clelland reassigned CB-6146:
--------------------------------

    Assignee: Ian Clelland

> 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)

Reply via email to