You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Mike Billau <mi...@gmail.com> on 2014/04/16 19:57:52 UTC

should FileTransfer.download() auto mkdir target's path?

Hello,

When using FileTransfer.download(), if the target location contains folders
that do not exist on the device, should FileTransfer auto-magically mkdir
these folders to save the download?

If target= /foo/image.png, and if /foo/ doesn't exist, Android will create
the /foo/ dir for you. WP8 doesn't seem to do this and will instead return
with an error. I don't know which implementation should be considered
"correct." It seems like a "good" dev should first check that the target
exists and create it before saving the image, but I'm all for making things
easier for the developer and just doing it auto-magically (I hate that
word...)

I'm using 3.1 btw, sigh and sorry! Thanks everyone for your opinions.

Re: should FileTransfer.download() auto mkdir target's path?

Posted by Michal Mocny <mm...@chromium.org>.
FileTransfer is supposed to be a dead simple helper, not a fundamental
system api.  So that suggests to me that we should prefer to auto-create.

-Michal


On Wed, Apr 16, 2014 at 1:57 PM, Mike Billau <mi...@gmail.com> wrote:

> Hello,
>
> When using FileTransfer.download(), if the target location contains folders
> that do not exist on the device, should FileTransfer auto-magically mkdir
> these folders to save the download?
>
> If target= /foo/image.png, and if /foo/ doesn't exist, Android will create
> the /foo/ dir for you. WP8 doesn't seem to do this and will instead return
> with an error. I don't know which implementation should be considered
> "correct." It seems like a "good" dev should first check that the target
> exists and create it before saving the image, but I'm all for making things
> easier for the developer and just doing it auto-magically (I hate that
> word...)
>
> I'm using 3.1 btw, sigh and sorry! Thanks everyone for your opinions.
>

Re: should FileTransfer.download() auto mkdir target's path?

Posted by Jesse <pu...@gmail.com>.
Can't find the original issue, but it was specific to file and not
file-transfer...

>From the File Spec [1] ( which is somewhat inherited by the File transfer
plugin )

+ It is an error to attempt to create a directory whose immediate parent
does not yet exist.
+ It is an error to attempt to create a file whose immediate parent does
not yet exist.

Whether we view the file-transfer plugin as a high level helper that hides
these details, or as a strict extension to the File plugin is up for
discussion.


[1] http://www.w3.org/TR/2011/WD-file-system-api-20110419/

@purplecabbage
risingj.com


On Wed, Apr 16, 2014 at 12:32 PM, Jesse <pu...@gmail.com> wrote:

> Originally WP8 was creating any missing intermediate folders, but this was
> raised as a defect because the spec explicitly states it should produce an
> error in this case.
> Trying to dig up the issue ...
>
>
> @purplecabbage
> risingj.com
>
>
> On Wed, Apr 16, 2014 at 12:07 PM, James Jong <wj...@gmail.com> wrote:
>
>> I think iOS attempts to create the directory first.
>>
>> https://github.com/apache/cordova-plugin-file-transfer/blob/master/src/ios/CDVFileTransfer.m#L660
>> -James Jong
>>
>> On Apr 16, 2014, at 2:58 PM, Shazron <sh...@gmail.com> wrote:
>>
>> > Additional info:
>> > iOS will not create intermediate folders for download(), they must
>> already
>> > exist
>> > (based on my tests with NSFileManager
>> createFileAtPath:contents:attributes
>> > call that is used by FileTransfer.download())
>> >
>> >
>> > On Wed, Apr 16, 2014 at 10:57 AM, Mike Billau <mi...@gmail.com>
>> wrote:
>> >
>> >> Hello,
>> >>
>> >> When using FileTransfer.download(), if the target location contains
>> folders
>> >> that do not exist on the device, should FileTransfer auto-magically
>> mkdir
>> >> these folders to save the download?
>> >>
>> >> If target= /foo/image.png, and if /foo/ doesn't exist, Android will
>> create
>> >> the /foo/ dir for you. WP8 doesn't seem to do this and will instead
>> return
>> >> with an error. I don't know which implementation should be considered
>> >> "correct." It seems like a "good" dev should first check that the
>> target
>> >> exists and create it before saving the image, but I'm all for making
>> things
>> >> easier for the developer and just doing it auto-magically (I hate that
>> >> word...)
>> >>
>> >> I'm using 3.1 btw, sigh and sorry! Thanks everyone for your opinions.
>> >>
>>
>>
>

Re: should FileTransfer.download() auto mkdir target's path?

Posted by James Jong <wj...@gmail.com>.
me too! ;-)
-James Jong

On Apr 17, 2014, at 11:02 AM, Ian Clelland <ic...@google.com> wrote:

> On Thu, Apr 17, 2014 at 10:33 AM, purplecabbage <pu...@gmail.com>wrote:
> 
>> I assume Ian and James mean consistency between current implementations on
>> wp/ios/android ...
>> and not between File+FileTransfer.
>> 
> 
> Yes, this is exactly what I meant :)
> 
> Me too!
>> Go ahead and create the issue Mike.
>> 
>> 
>> Sent from my iPhone
>> 
>>> On Apr 17, 2014, at 7:07 AM, James Jong <wj...@gmail.com> wrote:
>>> 
>>> +1 for consistency
>>> -James Jong
>>> 
>>>> On Apr 17, 2014, at 8:36 AM, Ian Clelland <ic...@chromium.org>
>> wrote:
>>>> 
>>>> +1 for consistency, and the simplest API.
>>>> 
>>>> 
>>>> 
>>>> On Thu, Apr 17, 2014 at 8:29 AM, Mike Billau <mi...@gmail.com>
>> wrote:
>>>> 
>>>>>> 
>>>>>> We can choose to make file-transfer it's own (higher level) thing with
>>>>> it's
>>>>>> own conventions, or we can aim for cohesiveness ... the original
>> design
>>>>> was
>>>>>> based on being cohesive, I think.
>>>>> 
>>>>> While I feel like being cohesive and in line with the File API is the
>>>>> better choice, it seems that since Android and iOS already implement
>> the
>>>>> mkdir functionality, FileTransfer is already its own thing. It seems
>> like
>>>>> it would be more of a headache to deprecate the mkdir feature on
>> Android
>>>>> and iOS than it would be to just say "FileTransfer is it's own higher
>> level
>>>>> thing" and bring WP8 into alignment. And who knows, maybe we will want
>> to
>>>>> add new functionality into FileTransfer in the future (although I can't
>>>>> think of any examples.) If nobody has any issues I'll create the JIRA
>> issue
>>>>> for WP8.
>>>>> 
>>>>> 
>>>>> 
>>>>>> On Wed, Apr 16, 2014 at 3:50 PM, Jesse <pu...@gmail.com>
>> wrote:
>>>>>> 
>>>>>> No, no spec, the issue was a File API issue, and the file-transfer
>> plugin
>>>>>> inherits some of the conventions.
>>>>>> We can choose to make file-transfer it's own (higher level) thing with
>>>>> it's
>>>>>> own conventions, or we can aim for cohesiveness ... the original
>> design
>>>>> was
>>>>>> based on being cohesive, I think.
>>>>>> 
>>>>>> 
>>>>>> @purplecabbage
>>>>>> risingj.com
>>>>>> 
>>>>>> 
>>>>>> On Wed, Apr 16, 2014 at 12:42 PM, Ian Clelland <
>> iclelland@chromium.org
>>>>>>> wrote:
>>>>>> 
>>>>>>> There's a spec? I thought filetransfer was something that PhoneGap
>>>>>>> introduced.
>>>>>>> 
>>>>>>> 
>>>>>>> On Wed, Apr 16, 2014 at 3:32 PM, Jesse <pu...@gmail.com>
>>>>> wrote:
>>>>>>> 
>>>>>>>> Originally WP8 was creating any missing intermediate folders, but
>>>>> this
>>>>>>> was
>>>>>>>> raised as a defect because the spec explicitly states it should
>>>>> produce
>>>>>>> an
>>>>>>>> error in this case.
>>>>>>>> Trying to dig up the issue ...
>>>>>>>> 
>>>>>>>> 
>>>>>>>> @purplecabbage
>>>>>>>> risingj.com
>>>>>>>> 
>>>>>>>> 
>>>>>>>>> On Wed, Apr 16, 2014 at 12:07 PM, James Jong <wjamesjong@gmail.com
>>> 
>>>>>>>> wrote:
>>>>>>>> 
>>>>>>>>> I think iOS attempts to create the directory first.
>>>>> 
>> https://github.com/apache/cordova-plugin-file-transfer/blob/master/src/ios/CDVFileTransfer.m#L660
>>>>>>>>> -James Jong
>>>>>>>>> 
>>>>>>>>>> On Apr 16, 2014, at 2:58 PM, Shazron <sh...@gmail.com> wrote:
>>>>>>>>>> 
>>>>>>>>>> Additional info:
>>>>>>>>>> iOS will not create intermediate folders for download(), they
>>>>> must
>>>>>>>>> already
>>>>>>>>>> exist
>>>>>>>>>> (based on my tests with NSFileManager
>>>>>>>>> createFileAtPath:contents:attributes
>>>>>>>>>> call that is used by FileTransfer.download())
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> On Wed, Apr 16, 2014 at 10:57 AM, Mike Billau <
>>>>>> mike.billau@gmail.com
>>>>>>>> 
>>>>>>>>> wrote:
>>>>>>>>>> 
>>>>>>>>>>> Hello,
>>>>>>>>>>> 
>>>>>>>>>>> When using FileTransfer.download(), if the target location
>>>>>> contains
>>>>>>>>> folders
>>>>>>>>>>> that do not exist on the device, should FileTransfer
>>>>>> auto-magically
>>>>>>>>> mkdir
>>>>>>>>>>> these folders to save the download?
>>>>>>>>>>> 
>>>>>>>>>>> If target= /foo/image.png, and if /foo/ doesn't exist, Android
>>>>>> will
>>>>>>>>> create
>>>>>>>>>>> the /foo/ dir for you. WP8 doesn't seem to do this and will
>>>>>> instead
>>>>>>>>> return
>>>>>>>>>>> with an error. I don't know which implementation should be
>>>>>>> considered
>>>>>>>>>>> "correct." It seems like a "good" dev should first check that
>>>>> the
>>>>>>>> target
>>>>>>>>>>> exists and create it before saving the image, but I'm all for
>>>>>> making
>>>>>>>>> things
>>>>>>>>>>> easier for the developer and just doing it auto-magically (I
>>>>> hate
>>>>>>> that
>>>>>>>>>>> word...)
>>>>>>>>>>> 
>>>>>>>>>>> I'm using 3.1 btw, sigh and sorry! Thanks everyone for your
>>>>>>> opinions.
>>> 
>> 


Re: should FileTransfer.download() auto mkdir target's path?

Posted by Ian Clelland <ic...@google.com>.
On Thu, Apr 17, 2014 at 10:33 AM, purplecabbage <pu...@gmail.com>wrote:

> I assume Ian and James mean consistency between current implementations on
> wp/ios/android ...
> and not between File+FileTransfer.
>

Yes, this is exactly what I meant :)

Me too!
> Go ahead and create the issue Mike.
>
>
> Sent from my iPhone
>
> > On Apr 17, 2014, at 7:07 AM, James Jong <wj...@gmail.com> wrote:
> >
> > +1 for consistency
> > -James Jong
> >
> >> On Apr 17, 2014, at 8:36 AM, Ian Clelland <ic...@chromium.org>
> wrote:
> >>
> >> +1 for consistency, and the simplest API.
> >>
> >>
> >>
> >> On Thu, Apr 17, 2014 at 8:29 AM, Mike Billau <mi...@gmail.com>
> wrote:
> >>
> >>>>
> >>>> We can choose to make file-transfer it's own (higher level) thing with
> >>> it's
> >>>> own conventions, or we can aim for cohesiveness ... the original
> design
> >>> was
> >>>> based on being cohesive, I think.
> >>>
> >>> While I feel like being cohesive and in line with the File API is the
> >>> better choice, it seems that since Android and iOS already implement
> the
> >>> mkdir functionality, FileTransfer is already its own thing. It seems
> like
> >>> it would be more of a headache to deprecate the mkdir feature on
> Android
> >>> and iOS than it would be to just say "FileTransfer is it's own higher
> level
> >>> thing" and bring WP8 into alignment. And who knows, maybe we will want
> to
> >>> add new functionality into FileTransfer in the future (although I can't
> >>> think of any examples.) If nobody has any issues I'll create the JIRA
> issue
> >>> for WP8.
> >>>
> >>>
> >>>
> >>>> On Wed, Apr 16, 2014 at 3:50 PM, Jesse <pu...@gmail.com>
> wrote:
> >>>>
> >>>> No, no spec, the issue was a File API issue, and the file-transfer
> plugin
> >>>> inherits some of the conventions.
> >>>> We can choose to make file-transfer it's own (higher level) thing with
> >>> it's
> >>>> own conventions, or we can aim for cohesiveness ... the original
> design
> >>> was
> >>>> based on being cohesive, I think.
> >>>>
> >>>>
> >>>> @purplecabbage
> >>>> risingj.com
> >>>>
> >>>>
> >>>> On Wed, Apr 16, 2014 at 12:42 PM, Ian Clelland <
> iclelland@chromium.org
> >>>>> wrote:
> >>>>
> >>>>> There's a spec? I thought filetransfer was something that PhoneGap
> >>>>> introduced.
> >>>>>
> >>>>>
> >>>>> On Wed, Apr 16, 2014 at 3:32 PM, Jesse <pu...@gmail.com>
> >>> wrote:
> >>>>>
> >>>>>> Originally WP8 was creating any missing intermediate folders, but
> >>> this
> >>>>> was
> >>>>>> raised as a defect because the spec explicitly states it should
> >>> produce
> >>>>> an
> >>>>>> error in this case.
> >>>>>> Trying to dig up the issue ...
> >>>>>>
> >>>>>>
> >>>>>> @purplecabbage
> >>>>>> risingj.com
> >>>>>>
> >>>>>>
> >>>>>>> On Wed, Apr 16, 2014 at 12:07 PM, James Jong <wjamesjong@gmail.com
> >
> >>>>>> wrote:
> >>>>>>
> >>>>>>> I think iOS attempts to create the directory first.
> >>>
> https://github.com/apache/cordova-plugin-file-transfer/blob/master/src/ios/CDVFileTransfer.m#L660
> >>>>>>> -James Jong
> >>>>>>>
> >>>>>>>> On Apr 16, 2014, at 2:58 PM, Shazron <sh...@gmail.com> wrote:
> >>>>>>>>
> >>>>>>>> Additional info:
> >>>>>>>> iOS will not create intermediate folders for download(), they
> >>> must
> >>>>>>> already
> >>>>>>>> exist
> >>>>>>>> (based on my tests with NSFileManager
> >>>>>>> createFileAtPath:contents:attributes
> >>>>>>>> call that is used by FileTransfer.download())
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> On Wed, Apr 16, 2014 at 10:57 AM, Mike Billau <
> >>>> mike.billau@gmail.com
> >>>>>>
> >>>>>>> wrote:
> >>>>>>>>
> >>>>>>>>> Hello,
> >>>>>>>>>
> >>>>>>>>> When using FileTransfer.download(), if the target location
> >>>> contains
> >>>>>>> folders
> >>>>>>>>> that do not exist on the device, should FileTransfer
> >>>> auto-magically
> >>>>>>> mkdir
> >>>>>>>>> these folders to save the download?
> >>>>>>>>>
> >>>>>>>>> If target= /foo/image.png, and if /foo/ doesn't exist, Android
> >>>> will
> >>>>>>> create
> >>>>>>>>> the /foo/ dir for you. WP8 doesn't seem to do this and will
> >>>> instead
> >>>>>>> return
> >>>>>>>>> with an error. I don't know which implementation should be
> >>>>> considered
> >>>>>>>>> "correct." It seems like a "good" dev should first check that
> >>> the
> >>>>>> target
> >>>>>>>>> exists and create it before saving the image, but I'm all for
> >>>> making
> >>>>>>> things
> >>>>>>>>> easier for the developer and just doing it auto-magically (I
> >>> hate
> >>>>> that
> >>>>>>>>> word...)
> >>>>>>>>>
> >>>>>>>>> I'm using 3.1 btw, sigh and sorry! Thanks everyone for your
> >>>>> opinions.
> >
>

Re: should FileTransfer.download() auto mkdir target's path?

Posted by purplecabbage <pu...@gmail.com>.
I assume Ian and James mean consistency between current implementations on wp/ios/android ...
and not between File+FileTransfer. 
Me too!
Go ahead and create the issue Mike. 


Sent from my iPhone

> On Apr 17, 2014, at 7:07 AM, James Jong <wj...@gmail.com> wrote:
> 
> +1 for consistency
> -James Jong
> 
>> On Apr 17, 2014, at 8:36 AM, Ian Clelland <ic...@chromium.org> wrote:
>> 
>> +1 for consistency, and the simplest API.
>> 
>> 
>> 
>> On Thu, Apr 17, 2014 at 8:29 AM, Mike Billau <mi...@gmail.com> wrote:
>> 
>>>> 
>>>> We can choose to make file-transfer it's own (higher level) thing with
>>> it's
>>>> own conventions, or we can aim for cohesiveness ... the original design
>>> was
>>>> based on being cohesive, I think.
>>> 
>>> While I feel like being cohesive and in line with the File API is the
>>> better choice, it seems that since Android and iOS already implement the
>>> mkdir functionality, FileTransfer is already its own thing. It seems like
>>> it would be more of a headache to deprecate the mkdir feature on Android
>>> and iOS than it would be to just say "FileTransfer is it's own higher level
>>> thing" and bring WP8 into alignment. And who knows, maybe we will want to
>>> add new functionality into FileTransfer in the future (although I can't
>>> think of any examples.) If nobody has any issues I'll create the JIRA issue
>>> for WP8.
>>> 
>>> 
>>> 
>>>> On Wed, Apr 16, 2014 at 3:50 PM, Jesse <pu...@gmail.com> wrote:
>>>> 
>>>> No, no spec, the issue was a File API issue, and the file-transfer plugin
>>>> inherits some of the conventions.
>>>> We can choose to make file-transfer it's own (higher level) thing with
>>> it's
>>>> own conventions, or we can aim for cohesiveness ... the original design
>>> was
>>>> based on being cohesive, I think.
>>>> 
>>>> 
>>>> @purplecabbage
>>>> risingj.com
>>>> 
>>>> 
>>>> On Wed, Apr 16, 2014 at 12:42 PM, Ian Clelland <iclelland@chromium.org
>>>>> wrote:
>>>> 
>>>>> There's a spec? I thought filetransfer was something that PhoneGap
>>>>> introduced.
>>>>> 
>>>>> 
>>>>> On Wed, Apr 16, 2014 at 3:32 PM, Jesse <pu...@gmail.com>
>>> wrote:
>>>>> 
>>>>>> Originally WP8 was creating any missing intermediate folders, but
>>> this
>>>>> was
>>>>>> raised as a defect because the spec explicitly states it should
>>> produce
>>>>> an
>>>>>> error in this case.
>>>>>> Trying to dig up the issue ...
>>>>>> 
>>>>>> 
>>>>>> @purplecabbage
>>>>>> risingj.com
>>>>>> 
>>>>>> 
>>>>>>> On Wed, Apr 16, 2014 at 12:07 PM, James Jong <wj...@gmail.com>
>>>>>> wrote:
>>>>>> 
>>>>>>> I think iOS attempts to create the directory first.
>>> https://github.com/apache/cordova-plugin-file-transfer/blob/master/src/ios/CDVFileTransfer.m#L660
>>>>>>> -James Jong
>>>>>>> 
>>>>>>>> On Apr 16, 2014, at 2:58 PM, Shazron <sh...@gmail.com> wrote:
>>>>>>>> 
>>>>>>>> Additional info:
>>>>>>>> iOS will not create intermediate folders for download(), they
>>> must
>>>>>>> already
>>>>>>>> exist
>>>>>>>> (based on my tests with NSFileManager
>>>>>>> createFileAtPath:contents:attributes
>>>>>>>> call that is used by FileTransfer.download())
>>>>>>>> 
>>>>>>>> 
>>>>>>>> On Wed, Apr 16, 2014 at 10:57 AM, Mike Billau <
>>>> mike.billau@gmail.com
>>>>>> 
>>>>>>> wrote:
>>>>>>>> 
>>>>>>>>> Hello,
>>>>>>>>> 
>>>>>>>>> When using FileTransfer.download(), if the target location
>>>> contains
>>>>>>> folders
>>>>>>>>> that do not exist on the device, should FileTransfer
>>>> auto-magically
>>>>>>> mkdir
>>>>>>>>> these folders to save the download?
>>>>>>>>> 
>>>>>>>>> If target= /foo/image.png, and if /foo/ doesn't exist, Android
>>>> will
>>>>>>> create
>>>>>>>>> the /foo/ dir for you. WP8 doesn't seem to do this and will
>>>> instead
>>>>>>> return
>>>>>>>>> with an error. I don't know which implementation should be
>>>>> considered
>>>>>>>>> "correct." It seems like a "good" dev should first check that
>>> the
>>>>>> target
>>>>>>>>> exists and create it before saving the image, but I'm all for
>>>> making
>>>>>>> things
>>>>>>>>> easier for the developer and just doing it auto-magically (I
>>> hate
>>>>> that
>>>>>>>>> word...)
>>>>>>>>> 
>>>>>>>>> I'm using 3.1 btw, sigh and sorry! Thanks everyone for your
>>>>> opinions.
> 

Re: should FileTransfer.download() auto mkdir target's path?

Posted by Mike Billau <mi...@gmail.com>.
https://issues.apache.org/jira/browse/CB-6466

Thanks everyone.


On Thu, Apr 17, 2014 at 10:07 AM, James Jong <wj...@gmail.com> wrote:

> +1 for consistency
> -James Jong
>
> On Apr 17, 2014, at 8:36 AM, Ian Clelland <ic...@chromium.org> wrote:
>
> > +1 for consistency, and the simplest API.
> >
> >
> >
> > On Thu, Apr 17, 2014 at 8:29 AM, Mike Billau <mi...@gmail.com>
> wrote:
> >
> >>>
> >>> We can choose to make file-transfer it's own (higher level) thing with
> >> it's
> >>> own conventions, or we can aim for cohesiveness ... the original design
> >> was
> >>> based on being cohesive, I think.
> >>>
> >>
> >> While I feel like being cohesive and in line with the File API is the
> >> better choice, it seems that since Android and iOS already implement the
> >> mkdir functionality, FileTransfer is already its own thing. It seems
> like
> >> it would be more of a headache to deprecate the mkdir feature on Android
> >> and iOS than it would be to just say "FileTransfer is it's own higher
> level
> >> thing" and bring WP8 into alignment. And who knows, maybe we will want
> to
> >> add new functionality into FileTransfer in the future (although I can't
> >> think of any examples.) If nobody has any issues I'll create the JIRA
> issue
> >> for WP8.
> >>
> >>
> >>
> >> On Wed, Apr 16, 2014 at 3:50 PM, Jesse <pu...@gmail.com> wrote:
> >>
> >>> No, no spec, the issue was a File API issue, and the file-transfer
> plugin
> >>> inherits some of the conventions.
> >>> We can choose to make file-transfer it's own (higher level) thing with
> >> it's
> >>> own conventions, or we can aim for cohesiveness ... the original design
> >> was
> >>> based on being cohesive, I think.
> >>>
> >>>
> >>> @purplecabbage
> >>> risingj.com
> >>>
> >>>
> >>> On Wed, Apr 16, 2014 at 12:42 PM, Ian Clelland <iclelland@chromium.org
> >>>> wrote:
> >>>
> >>>> There's a spec? I thought filetransfer was something that PhoneGap
> >>>> introduced.
> >>>>
> >>>>
> >>>> On Wed, Apr 16, 2014 at 3:32 PM, Jesse <pu...@gmail.com>
> >> wrote:
> >>>>
> >>>>> Originally WP8 was creating any missing intermediate folders, but
> >> this
> >>>> was
> >>>>> raised as a defect because the spec explicitly states it should
> >> produce
> >>>> an
> >>>>> error in this case.
> >>>>> Trying to dig up the issue ...
> >>>>>
> >>>>>
> >>>>> @purplecabbage
> >>>>> risingj.com
> >>>>>
> >>>>>
> >>>>> On Wed, Apr 16, 2014 at 12:07 PM, James Jong <wj...@gmail.com>
> >>>> wrote:
> >>>>>
> >>>>>> I think iOS attempts to create the directory first.
> >>>>>>
> >>>>>>
> >>>>>
> >>>>
> >>>
> >>
> https://github.com/apache/cordova-plugin-file-transfer/blob/master/src/ios/CDVFileTransfer.m#L660
> >>>>>> -James Jong
> >>>>>>
> >>>>>> On Apr 16, 2014, at 2:58 PM, Shazron <sh...@gmail.com> wrote:
> >>>>>>
> >>>>>>> Additional info:
> >>>>>>> iOS will not create intermediate folders for download(), they
> >> must
> >>>>>> already
> >>>>>>> exist
> >>>>>>> (based on my tests with NSFileManager
> >>>>>> createFileAtPath:contents:attributes
> >>>>>>> call that is used by FileTransfer.download())
> >>>>>>>
> >>>>>>>
> >>>>>>> On Wed, Apr 16, 2014 at 10:57 AM, Mike Billau <
> >>> mike.billau@gmail.com
> >>>>>
> >>>>>> wrote:
> >>>>>>>
> >>>>>>>> Hello,
> >>>>>>>>
> >>>>>>>> When using FileTransfer.download(), if the target location
> >>> contains
> >>>>>> folders
> >>>>>>>> that do not exist on the device, should FileTransfer
> >>> auto-magically
> >>>>>> mkdir
> >>>>>>>> these folders to save the download?
> >>>>>>>>
> >>>>>>>> If target= /foo/image.png, and if /foo/ doesn't exist, Android
> >>> will
> >>>>>> create
> >>>>>>>> the /foo/ dir for you. WP8 doesn't seem to do this and will
> >>> instead
> >>>>>> return
> >>>>>>>> with an error. I don't know which implementation should be
> >>>> considered
> >>>>>>>> "correct." It seems like a "good" dev should first check that
> >> the
> >>>>> target
> >>>>>>>> exists and create it before saving the image, but I'm all for
> >>> making
> >>>>>> things
> >>>>>>>> easier for the developer and just doing it auto-magically (I
> >> hate
> >>>> that
> >>>>>>>> word...)
> >>>>>>>>
> >>>>>>>> I'm using 3.1 btw, sigh and sorry! Thanks everyone for your
> >>>> opinions.
> >>>>>>>>
> >>>>>>
> >>>>>>
> >>>>>
> >>>>
> >>>
> >>
>
>

Re: should FileTransfer.download() auto mkdir target's path?

Posted by James Jong <wj...@gmail.com>.
+1 for consistency
-James Jong

On Apr 17, 2014, at 8:36 AM, Ian Clelland <ic...@chromium.org> wrote:

> +1 for consistency, and the simplest API.
> 
> 
> 
> On Thu, Apr 17, 2014 at 8:29 AM, Mike Billau <mi...@gmail.com> wrote:
> 
>>> 
>>> We can choose to make file-transfer it's own (higher level) thing with
>> it's
>>> own conventions, or we can aim for cohesiveness ... the original design
>> was
>>> based on being cohesive, I think.
>>> 
>> 
>> While I feel like being cohesive and in line with the File API is the
>> better choice, it seems that since Android and iOS already implement the
>> mkdir functionality, FileTransfer is already its own thing. It seems like
>> it would be more of a headache to deprecate the mkdir feature on Android
>> and iOS than it would be to just say "FileTransfer is it's own higher level
>> thing" and bring WP8 into alignment. And who knows, maybe we will want to
>> add new functionality into FileTransfer in the future (although I can't
>> think of any examples.) If nobody has any issues I'll create the JIRA issue
>> for WP8.
>> 
>> 
>> 
>> On Wed, Apr 16, 2014 at 3:50 PM, Jesse <pu...@gmail.com> wrote:
>> 
>>> No, no spec, the issue was a File API issue, and the file-transfer plugin
>>> inherits some of the conventions.
>>> We can choose to make file-transfer it's own (higher level) thing with
>> it's
>>> own conventions, or we can aim for cohesiveness ... the original design
>> was
>>> based on being cohesive, I think.
>>> 
>>> 
>>> @purplecabbage
>>> risingj.com
>>> 
>>> 
>>> On Wed, Apr 16, 2014 at 12:42 PM, Ian Clelland <iclelland@chromium.org
>>>> wrote:
>>> 
>>>> There's a spec? I thought filetransfer was something that PhoneGap
>>>> introduced.
>>>> 
>>>> 
>>>> On Wed, Apr 16, 2014 at 3:32 PM, Jesse <pu...@gmail.com>
>> wrote:
>>>> 
>>>>> Originally WP8 was creating any missing intermediate folders, but
>> this
>>>> was
>>>>> raised as a defect because the spec explicitly states it should
>> produce
>>>> an
>>>>> error in this case.
>>>>> Trying to dig up the issue ...
>>>>> 
>>>>> 
>>>>> @purplecabbage
>>>>> risingj.com
>>>>> 
>>>>> 
>>>>> On Wed, Apr 16, 2014 at 12:07 PM, James Jong <wj...@gmail.com>
>>>> wrote:
>>>>> 
>>>>>> I think iOS attempts to create the directory first.
>>>>>> 
>>>>>> 
>>>>> 
>>>> 
>>> 
>> https://github.com/apache/cordova-plugin-file-transfer/blob/master/src/ios/CDVFileTransfer.m#L660
>>>>>> -James Jong
>>>>>> 
>>>>>> On Apr 16, 2014, at 2:58 PM, Shazron <sh...@gmail.com> wrote:
>>>>>> 
>>>>>>> Additional info:
>>>>>>> iOS will not create intermediate folders for download(), they
>> must
>>>>>> already
>>>>>>> exist
>>>>>>> (based on my tests with NSFileManager
>>>>>> createFileAtPath:contents:attributes
>>>>>>> call that is used by FileTransfer.download())
>>>>>>> 
>>>>>>> 
>>>>>>> On Wed, Apr 16, 2014 at 10:57 AM, Mike Billau <
>>> mike.billau@gmail.com
>>>>> 
>>>>>> wrote:
>>>>>>> 
>>>>>>>> Hello,
>>>>>>>> 
>>>>>>>> When using FileTransfer.download(), if the target location
>>> contains
>>>>>> folders
>>>>>>>> that do not exist on the device, should FileTransfer
>>> auto-magically
>>>>>> mkdir
>>>>>>>> these folders to save the download?
>>>>>>>> 
>>>>>>>> If target= /foo/image.png, and if /foo/ doesn't exist, Android
>>> will
>>>>>> create
>>>>>>>> the /foo/ dir for you. WP8 doesn't seem to do this and will
>>> instead
>>>>>> return
>>>>>>>> with an error. I don't know which implementation should be
>>>> considered
>>>>>>>> "correct." It seems like a "good" dev should first check that
>> the
>>>>> target
>>>>>>>> exists and create it before saving the image, but I'm all for
>>> making
>>>>>> things
>>>>>>>> easier for the developer and just doing it auto-magically (I
>> hate
>>>> that
>>>>>>>> word...)
>>>>>>>> 
>>>>>>>> I'm using 3.1 btw, sigh and sorry! Thanks everyone for your
>>>> opinions.
>>>>>>>> 
>>>>>> 
>>>>>> 
>>>>> 
>>>> 
>>> 
>> 


Re: should FileTransfer.download() auto mkdir target's path?

Posted by Ian Clelland <ic...@chromium.org>.
+1 for consistency, and the simplest API.



On Thu, Apr 17, 2014 at 8:29 AM, Mike Billau <mi...@gmail.com> wrote:

> >
> > We can choose to make file-transfer it's own (higher level) thing with
> it's
> > own conventions, or we can aim for cohesiveness ... the original design
> was
> > based on being cohesive, I think.
> >
>
> While I feel like being cohesive and in line with the File API is the
> better choice, it seems that since Android and iOS already implement the
> mkdir functionality, FileTransfer is already its own thing. It seems like
> it would be more of a headache to deprecate the mkdir feature on Android
> and iOS than it would be to just say "FileTransfer is it's own higher level
> thing" and bring WP8 into alignment. And who knows, maybe we will want to
> add new functionality into FileTransfer in the future (although I can't
> think of any examples.) If nobody has any issues I'll create the JIRA issue
> for WP8.
>
>
>
> On Wed, Apr 16, 2014 at 3:50 PM, Jesse <pu...@gmail.com> wrote:
>
> > No, no spec, the issue was a File API issue, and the file-transfer plugin
> > inherits some of the conventions.
> > We can choose to make file-transfer it's own (higher level) thing with
> it's
> > own conventions, or we can aim for cohesiveness ... the original design
> was
> > based on being cohesive, I think.
> >
> >
> > @purplecabbage
> > risingj.com
> >
> >
> > On Wed, Apr 16, 2014 at 12:42 PM, Ian Clelland <iclelland@chromium.org
> > >wrote:
> >
> > > There's a spec? I thought filetransfer was something that PhoneGap
> > > introduced.
> > >
> > >
> > > On Wed, Apr 16, 2014 at 3:32 PM, Jesse <pu...@gmail.com>
> wrote:
> > >
> > > > Originally WP8 was creating any missing intermediate folders, but
> this
> > > was
> > > > raised as a defect because the spec explicitly states it should
> produce
> > > an
> > > > error in this case.
> > > > Trying to dig up the issue ...
> > > >
> > > >
> > > > @purplecabbage
> > > > risingj.com
> > > >
> > > >
> > > > On Wed, Apr 16, 2014 at 12:07 PM, James Jong <wj...@gmail.com>
> > > wrote:
> > > >
> > > > > I think iOS attempts to create the directory first.
> > > > >
> > > > >
> > > >
> > >
> >
> https://github.com/apache/cordova-plugin-file-transfer/blob/master/src/ios/CDVFileTransfer.m#L660
> > > > > -James Jong
> > > > >
> > > > > On Apr 16, 2014, at 2:58 PM, Shazron <sh...@gmail.com> wrote:
> > > > >
> > > > > > Additional info:
> > > > > > iOS will not create intermediate folders for download(), they
> must
> > > > > already
> > > > > > exist
> > > > > > (based on my tests with NSFileManager
> > > > > createFileAtPath:contents:attributes
> > > > > > call that is used by FileTransfer.download())
> > > > > >
> > > > > >
> > > > > > On Wed, Apr 16, 2014 at 10:57 AM, Mike Billau <
> > mike.billau@gmail.com
> > > >
> > > > > wrote:
> > > > > >
> > > > > >> Hello,
> > > > > >>
> > > > > >> When using FileTransfer.download(), if the target location
> > contains
> > > > > folders
> > > > > >> that do not exist on the device, should FileTransfer
> > auto-magically
> > > > > mkdir
> > > > > >> these folders to save the download?
> > > > > >>
> > > > > >> If target= /foo/image.png, and if /foo/ doesn't exist, Android
> > will
> > > > > create
> > > > > >> the /foo/ dir for you. WP8 doesn't seem to do this and will
> > instead
> > > > > return
> > > > > >> with an error. I don't know which implementation should be
> > > considered
> > > > > >> "correct." It seems like a "good" dev should first check that
> the
> > > > target
> > > > > >> exists and create it before saving the image, but I'm all for
> > making
> > > > > things
> > > > > >> easier for the developer and just doing it auto-magically (I
> hate
> > > that
> > > > > >> word...)
> > > > > >>
> > > > > >> I'm using 3.1 btw, sigh and sorry! Thanks everyone for your
> > > opinions.
> > > > > >>
> > > > >
> > > > >
> > > >
> > >
> >
>

Re: should FileTransfer.download() auto mkdir target's path?

Posted by Mike Billau <mi...@gmail.com>.
>
> We can choose to make file-transfer it's own (higher level) thing with it's
> own conventions, or we can aim for cohesiveness ... the original design was
> based on being cohesive, I think.
>

While I feel like being cohesive and in line with the File API is the
better choice, it seems that since Android and iOS already implement the
mkdir functionality, FileTransfer is already its own thing. It seems like
it would be more of a headache to deprecate the mkdir feature on Android
and iOS than it would be to just say "FileTransfer is it's own higher level
thing" and bring WP8 into alignment. And who knows, maybe we will want to
add new functionality into FileTransfer in the future (although I can't
think of any examples.) If nobody has any issues I'll create the JIRA issue
for WP8.



On Wed, Apr 16, 2014 at 3:50 PM, Jesse <pu...@gmail.com> wrote:

> No, no spec, the issue was a File API issue, and the file-transfer plugin
> inherits some of the conventions.
> We can choose to make file-transfer it's own (higher level) thing with it's
> own conventions, or we can aim for cohesiveness ... the original design was
> based on being cohesive, I think.
>
>
> @purplecabbage
> risingj.com
>
>
> On Wed, Apr 16, 2014 at 12:42 PM, Ian Clelland <iclelland@chromium.org
> >wrote:
>
> > There's a spec? I thought filetransfer was something that PhoneGap
> > introduced.
> >
> >
> > On Wed, Apr 16, 2014 at 3:32 PM, Jesse <pu...@gmail.com> wrote:
> >
> > > Originally WP8 was creating any missing intermediate folders, but this
> > was
> > > raised as a defect because the spec explicitly states it should produce
> > an
> > > error in this case.
> > > Trying to dig up the issue ...
> > >
> > >
> > > @purplecabbage
> > > risingj.com
> > >
> > >
> > > On Wed, Apr 16, 2014 at 12:07 PM, James Jong <wj...@gmail.com>
> > wrote:
> > >
> > > > I think iOS attempts to create the directory first.
> > > >
> > > >
> > >
> >
> https://github.com/apache/cordova-plugin-file-transfer/blob/master/src/ios/CDVFileTransfer.m#L660
> > > > -James Jong
> > > >
> > > > On Apr 16, 2014, at 2:58 PM, Shazron <sh...@gmail.com> wrote:
> > > >
> > > > > Additional info:
> > > > > iOS will not create intermediate folders for download(), they must
> > > > already
> > > > > exist
> > > > > (based on my tests with NSFileManager
> > > > createFileAtPath:contents:attributes
> > > > > call that is used by FileTransfer.download())
> > > > >
> > > > >
> > > > > On Wed, Apr 16, 2014 at 10:57 AM, Mike Billau <
> mike.billau@gmail.com
> > >
> > > > wrote:
> > > > >
> > > > >> Hello,
> > > > >>
> > > > >> When using FileTransfer.download(), if the target location
> contains
> > > > folders
> > > > >> that do not exist on the device, should FileTransfer
> auto-magically
> > > > mkdir
> > > > >> these folders to save the download?
> > > > >>
> > > > >> If target= /foo/image.png, and if /foo/ doesn't exist, Android
> will
> > > > create
> > > > >> the /foo/ dir for you. WP8 doesn't seem to do this and will
> instead
> > > > return
> > > > >> with an error. I don't know which implementation should be
> > considered
> > > > >> "correct." It seems like a "good" dev should first check that the
> > > target
> > > > >> exists and create it before saving the image, but I'm all for
> making
> > > > things
> > > > >> easier for the developer and just doing it auto-magically (I hate
> > that
> > > > >> word...)
> > > > >>
> > > > >> I'm using 3.1 btw, sigh and sorry! Thanks everyone for your
> > opinions.
> > > > >>
> > > >
> > > >
> > >
> >
>

Re: should FileTransfer.download() auto mkdir target's path?

Posted by Jesse <pu...@gmail.com>.
No, no spec, the issue was a File API issue, and the file-transfer plugin
inherits some of the conventions.
We can choose to make file-transfer it's own (higher level) thing with it's
own conventions, or we can aim for cohesiveness ... the original design was
based on being cohesive, I think.


@purplecabbage
risingj.com


On Wed, Apr 16, 2014 at 12:42 PM, Ian Clelland <ic...@chromium.org>wrote:

> There's a spec? I thought filetransfer was something that PhoneGap
> introduced.
>
>
> On Wed, Apr 16, 2014 at 3:32 PM, Jesse <pu...@gmail.com> wrote:
>
> > Originally WP8 was creating any missing intermediate folders, but this
> was
> > raised as a defect because the spec explicitly states it should produce
> an
> > error in this case.
> > Trying to dig up the issue ...
> >
> >
> > @purplecabbage
> > risingj.com
> >
> >
> > On Wed, Apr 16, 2014 at 12:07 PM, James Jong <wj...@gmail.com>
> wrote:
> >
> > > I think iOS attempts to create the directory first.
> > >
> > >
> >
> https://github.com/apache/cordova-plugin-file-transfer/blob/master/src/ios/CDVFileTransfer.m#L660
> > > -James Jong
> > >
> > > On Apr 16, 2014, at 2:58 PM, Shazron <sh...@gmail.com> wrote:
> > >
> > > > Additional info:
> > > > iOS will not create intermediate folders for download(), they must
> > > already
> > > > exist
> > > > (based on my tests with NSFileManager
> > > createFileAtPath:contents:attributes
> > > > call that is used by FileTransfer.download())
> > > >
> > > >
> > > > On Wed, Apr 16, 2014 at 10:57 AM, Mike Billau <mike.billau@gmail.com
> >
> > > wrote:
> > > >
> > > >> Hello,
> > > >>
> > > >> When using FileTransfer.download(), if the target location contains
> > > folders
> > > >> that do not exist on the device, should FileTransfer auto-magically
> > > mkdir
> > > >> these folders to save the download?
> > > >>
> > > >> If target= /foo/image.png, and if /foo/ doesn't exist, Android will
> > > create
> > > >> the /foo/ dir for you. WP8 doesn't seem to do this and will instead
> > > return
> > > >> with an error. I don't know which implementation should be
> considered
> > > >> "correct." It seems like a "good" dev should first check that the
> > target
> > > >> exists and create it before saving the image, but I'm all for making
> > > things
> > > >> easier for the developer and just doing it auto-magically (I hate
> that
> > > >> word...)
> > > >>
> > > >> I'm using 3.1 btw, sigh and sorry! Thanks everyone for your
> opinions.
> > > >>
> > >
> > >
> >
>

Re: should FileTransfer.download() auto mkdir target's path?

Posted by Ian Clelland <ic...@chromium.org>.
There's a spec? I thought filetransfer was something that PhoneGap
introduced.


On Wed, Apr 16, 2014 at 3:32 PM, Jesse <pu...@gmail.com> wrote:

> Originally WP8 was creating any missing intermediate folders, but this was
> raised as a defect because the spec explicitly states it should produce an
> error in this case.
> Trying to dig up the issue ...
>
>
> @purplecabbage
> risingj.com
>
>
> On Wed, Apr 16, 2014 at 12:07 PM, James Jong <wj...@gmail.com> wrote:
>
> > I think iOS attempts to create the directory first.
> >
> >
> https://github.com/apache/cordova-plugin-file-transfer/blob/master/src/ios/CDVFileTransfer.m#L660
> > -James Jong
> >
> > On Apr 16, 2014, at 2:58 PM, Shazron <sh...@gmail.com> wrote:
> >
> > > Additional info:
> > > iOS will not create intermediate folders for download(), they must
> > already
> > > exist
> > > (based on my tests with NSFileManager
> > createFileAtPath:contents:attributes
> > > call that is used by FileTransfer.download())
> > >
> > >
> > > On Wed, Apr 16, 2014 at 10:57 AM, Mike Billau <mi...@gmail.com>
> > wrote:
> > >
> > >> Hello,
> > >>
> > >> When using FileTransfer.download(), if the target location contains
> > folders
> > >> that do not exist on the device, should FileTransfer auto-magically
> > mkdir
> > >> these folders to save the download?
> > >>
> > >> If target= /foo/image.png, and if /foo/ doesn't exist, Android will
> > create
> > >> the /foo/ dir for you. WP8 doesn't seem to do this and will instead
> > return
> > >> with an error. I don't know which implementation should be considered
> > >> "correct." It seems like a "good" dev should first check that the
> target
> > >> exists and create it before saving the image, but I'm all for making
> > things
> > >> easier for the developer and just doing it auto-magically (I hate that
> > >> word...)
> > >>
> > >> I'm using 3.1 btw, sigh and sorry! Thanks everyone for your opinions.
> > >>
> >
> >
>

Re: should FileTransfer.download() auto mkdir target's path?

Posted by Jesse <pu...@gmail.com>.
Originally WP8 was creating any missing intermediate folders, but this was
raised as a defect because the spec explicitly states it should produce an
error in this case.
Trying to dig up the issue ...


@purplecabbage
risingj.com


On Wed, Apr 16, 2014 at 12:07 PM, James Jong <wj...@gmail.com> wrote:

> I think iOS attempts to create the directory first.
>
> https://github.com/apache/cordova-plugin-file-transfer/blob/master/src/ios/CDVFileTransfer.m#L660
> -James Jong
>
> On Apr 16, 2014, at 2:58 PM, Shazron <sh...@gmail.com> wrote:
>
> > Additional info:
> > iOS will not create intermediate folders for download(), they must
> already
> > exist
> > (based on my tests with NSFileManager
> createFileAtPath:contents:attributes
> > call that is used by FileTransfer.download())
> >
> >
> > On Wed, Apr 16, 2014 at 10:57 AM, Mike Billau <mi...@gmail.com>
> wrote:
> >
> >> Hello,
> >>
> >> When using FileTransfer.download(), if the target location contains
> folders
> >> that do not exist on the device, should FileTransfer auto-magically
> mkdir
> >> these folders to save the download?
> >>
> >> If target= /foo/image.png, and if /foo/ doesn't exist, Android will
> create
> >> the /foo/ dir for you. WP8 doesn't seem to do this and will instead
> return
> >> with an error. I don't know which implementation should be considered
> >> "correct." It seems like a "good" dev should first check that the target
> >> exists and create it before saving the image, but I'm all for making
> things
> >> easier for the developer and just doing it auto-magically (I hate that
> >> word...)
> >>
> >> I'm using 3.1 btw, sigh and sorry! Thanks everyone for your opinions.
> >>
>
>

Re: should FileTransfer.download() auto mkdir target's path?

Posted by Shazron <sh...@gmail.com>.
Oops :P skipped the lines above the call I was testing...


On Wed, Apr 16, 2014 at 12:07 PM, James Jong <wj...@gmail.com> wrote:

> I think iOS attempts to create the directory first.
>
> https://github.com/apache/cordova-plugin-file-transfer/blob/master/src/ios/CDVFileTransfer.m#L660
> -James Jong
>
> On Apr 16, 2014, at 2:58 PM, Shazron <sh...@gmail.com> wrote:
>
> > Additional info:
> > iOS will not create intermediate folders for download(), they must
> already
> > exist
> > (based on my tests with NSFileManager
> createFileAtPath:contents:attributes
> > call that is used by FileTransfer.download())
> >
> >
> > On Wed, Apr 16, 2014 at 10:57 AM, Mike Billau <mi...@gmail.com>
> wrote:
> >
> >> Hello,
> >>
> >> When using FileTransfer.download(), if the target location contains
> folders
> >> that do not exist on the device, should FileTransfer auto-magically
> mkdir
> >> these folders to save the download?
> >>
> >> If target= /foo/image.png, and if /foo/ doesn't exist, Android will
> create
> >> the /foo/ dir for you. WP8 doesn't seem to do this and will instead
> return
> >> with an error. I don't know which implementation should be considered
> >> "correct." It seems like a "good" dev should first check that the target
> >> exists and create it before saving the image, but I'm all for making
> things
> >> easier for the developer and just doing it auto-magically (I hate that
> >> word...)
> >>
> >> I'm using 3.1 btw, sigh and sorry! Thanks everyone for your opinions.
> >>
>
>

Re: should FileTransfer.download() auto mkdir target's path?

Posted by James Jong <wj...@gmail.com>.
I think iOS attempts to create the directory first.
https://github.com/apache/cordova-plugin-file-transfer/blob/master/src/ios/CDVFileTransfer.m#L660
-James Jong

On Apr 16, 2014, at 2:58 PM, Shazron <sh...@gmail.com> wrote:

> Additional info:
> iOS will not create intermediate folders for download(), they must already
> exist
> (based on my tests with NSFileManager createFileAtPath:contents:attributes
> call that is used by FileTransfer.download())
> 
> 
> On Wed, Apr 16, 2014 at 10:57 AM, Mike Billau <mi...@gmail.com> wrote:
> 
>> Hello,
>> 
>> When using FileTransfer.download(), if the target location contains folders
>> that do not exist on the device, should FileTransfer auto-magically mkdir
>> these folders to save the download?
>> 
>> If target= /foo/image.png, and if /foo/ doesn't exist, Android will create
>> the /foo/ dir for you. WP8 doesn't seem to do this and will instead return
>> with an error. I don't know which implementation should be considered
>> "correct." It seems like a "good" dev should first check that the target
>> exists and create it before saving the image, but I'm all for making things
>> easier for the developer and just doing it auto-magically (I hate that
>> word...)
>> 
>> I'm using 3.1 btw, sigh and sorry! Thanks everyone for your opinions.
>> 


Re: should FileTransfer.download() auto mkdir target's path?

Posted by Shazron <sh...@gmail.com>.
Additional info:
iOS will not create intermediate folders for download(), they must already
exist
(based on my tests with NSFileManager createFileAtPath:contents:attributes
call that is used by FileTransfer.download())


On Wed, Apr 16, 2014 at 10:57 AM, Mike Billau <mi...@gmail.com> wrote:

> Hello,
>
> When using FileTransfer.download(), if the target location contains folders
> that do not exist on the device, should FileTransfer auto-magically mkdir
> these folders to save the download?
>
> If target= /foo/image.png, and if /foo/ doesn't exist, Android will create
> the /foo/ dir for you. WP8 doesn't seem to do this and will instead return
> with an error. I don't know which implementation should be considered
> "correct." It seems like a "good" dev should first check that the target
> exists and create it before saving the image, but I'm all for making things
> easier for the developer and just doing it auto-magically (I hate that
> word...)
>
> I'm using 3.1 btw, sigh and sorry! Thanks everyone for your opinions.
>