cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Farhad Farzaneh (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-6146) FileTransfer.upload does not support iOS asset library type of URL
Date Tue, 18 Mar 2014 17:51:45 GMT

    [ https://issues.apache.org/jira/browse/CB-6146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13939541#comment-13939541
] 

Farhad Farzaneh commented on CB-6146:
-------------------------------------

Sadly I'm unable to run my app on 3.4 on iOS 7.1 to test this.  Even doing a clean build using
"cordova create ..." followed by "cordova platform add iOS" and adding the plugins doesn't
run correctly with the simple example app. I'll submit other bug reports once I'm sure it's
not my stupidity that's the cause.

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

Mime
View raw message