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] [Updated] (CB-6146) FileTransfer.upload does not support iOS asset library type of URL
Date Sun, 02 Mar 2014 00:36:19 GMT

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

Farhad Farzaneh updated CB-6146:
--------------------------------

    Description: 
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...
 

> 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
>
> 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.1.5#6160)

Mime
View raw message