You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Max Woghiren <ma...@chromium.org> on 2013/01/11 19:21:01 UTC

Native URL functionality for files

Hi everyone,

I'm working on implementing chrome apps file system functionality using
Cordova.  I'm focusing on iOS first.

I'm planning on using AssetsLibrary to prevent having to (1) send actual
file data to and from JS unnecessarily and (2) save temporary copies of
files.

In order to use asset library URLs (and the equivalents on other
platforms), I'd like to add a third Camera DestinationType: NATIVE_URL.  In
iOS, Camera would send back the assets-library URL, which can then be
stored in a FileEntry.

This type of URL would then be handled wherever necessary.  For instance,
uploading an image to a server using FileTransfer would be able do it
directly from the photo library, since it'd be given the assets-library
URL.  File would have a bunch of changes to handle this as well.

Please let me know if you have any comments, concerns, or things to
consider about add this functionality.

Thanks!
-Max

Re: Native URL functionality for files

Posted by Shazron <sh...@gmail.com>.
Thanks Max!
https://github.com/apache/cordova-ios/pull/6


On Mon, Jan 14, 2013 at 10:22 AM, Max Woghiren <ma...@chromium.org> wrote:

> I've sent a pull request that adds a third option to the
> Camera.DestinationType and returns "not supported" errors in the relevant
> methods (for now).
>
>
> On Fri, Jan 11, 2013 at 3:03 PM, Shazron <sh...@gmail.com> wrote:
>
> > I like it. I seem to remember we discussed something related, like
> > document:// shortcut to files in the app's Documents folder as well (iOS
> > specific) but nothing came out of it.
> >
> > For those curious, AssetLibrary urls look like
> > this: assets-library://asset/asset.JPG?id=1000000003&ext=JPG
> >
> >
> > On Fri, Jan 11, 2013 at 10:21 AM, Max Woghiren <ma...@chromium.org>
> wrote:
> >
> > > Hi everyone,
> > >
> > > I'm working on implementing chrome apps file system functionality using
> > > Cordova.  I'm focusing on iOS first.
> > >
> > > I'm planning on using AssetsLibrary to prevent having to (1) send
> actual
> > > file data to and from JS unnecessarily and (2) save temporary copies of
> > > files.
> > >
> > > In order to use asset library URLs (and the equivalents on other
> > > platforms), I'd like to add a third Camera DestinationType: NATIVE_URL.
> >  In
> > > iOS, Camera would send back the assets-library URL, which can then be
> > > stored in a FileEntry.
> > >
> > > This type of URL would then be handled wherever necessary.  For
> instance,
> > > uploading an image to a server using FileTransfer would be able do it
> > > directly from the photo library, since it'd be given the assets-library
> > > URL.  File would have a bunch of changes to handle this as well.
> > >
> > > Please let me know if you have any comments, concerns, or things to
> > > consider about add this functionality.
> > >
> > > Thanks!
> > > -Max
> > >
> >
>

Re: Native URL functionality for files

Posted by Max Woghiren <ma...@chromium.org>.
I've sent a pull request that adds a third option to the
Camera.DestinationType and returns "not supported" errors in the relevant
methods (for now).


On Fri, Jan 11, 2013 at 3:03 PM, Shazron <sh...@gmail.com> wrote:

> I like it. I seem to remember we discussed something related, like
> document:// shortcut to files in the app's Documents folder as well (iOS
> specific) but nothing came out of it.
>
> For those curious, AssetLibrary urls look like
> this: assets-library://asset/asset.JPG?id=1000000003&ext=JPG
>
>
> On Fri, Jan 11, 2013 at 10:21 AM, Max Woghiren <ma...@chromium.org> wrote:
>
> > Hi everyone,
> >
> > I'm working on implementing chrome apps file system functionality using
> > Cordova.  I'm focusing on iOS first.
> >
> > I'm planning on using AssetsLibrary to prevent having to (1) send actual
> > file data to and from JS unnecessarily and (2) save temporary copies of
> > files.
> >
> > In order to use asset library URLs (and the equivalents on other
> > platforms), I'd like to add a third Camera DestinationType: NATIVE_URL.
>  In
> > iOS, Camera would send back the assets-library URL, which can then be
> > stored in a FileEntry.
> >
> > This type of URL would then be handled wherever necessary.  For instance,
> > uploading an image to a server using FileTransfer would be able do it
> > directly from the photo library, since it'd be given the assets-library
> > URL.  File would have a bunch of changes to handle this as well.
> >
> > Please let me know if you have any comments, concerns, or things to
> > consider about add this functionality.
> >
> > Thanks!
> > -Max
> >
>

Re: Native URL functionality for files

Posted by Shazron <sh...@gmail.com>.
I like it. I seem to remember we discussed something related, like
document:// shortcut to files in the app's Documents folder as well (iOS
specific) but nothing came out of it.

For those curious, AssetLibrary urls look like
this: assets-library://asset/asset.JPG?id=1000000003&ext=JPG


On Fri, Jan 11, 2013 at 10:21 AM, Max Woghiren <ma...@chromium.org> wrote:

> Hi everyone,
>
> I'm working on implementing chrome apps file system functionality using
> Cordova.  I'm focusing on iOS first.
>
> I'm planning on using AssetsLibrary to prevent having to (1) send actual
> file data to and from JS unnecessarily and (2) save temporary copies of
> files.
>
> In order to use asset library URLs (and the equivalents on other
> platforms), I'd like to add a third Camera DestinationType: NATIVE_URL.  In
> iOS, Camera would send back the assets-library URL, which can then be
> stored in a FileEntry.
>
> This type of URL would then be handled wherever necessary.  For instance,
> uploading an image to a server using FileTransfer would be able do it
> directly from the photo library, since it'd be given the assets-library
> URL.  File would have a bunch of changes to handle this as well.
>
> Please let me know if you have any comments, concerns, or things to
> consider about add this functionality.
>
> Thanks!
> -Max
>