Re: [whatwg] New File attributes creationDate, modificationDate and size

2010-05-18 Thread Eric Uhrhane
On Fri, May 14, 2010 at 5:05 PM, Arun Ranganathan a...@mozilla.com wrote:
 On 5/12/10 4:25 AM, Ashley Sheridan wrote:

 On Wed, 2010-05-12 at 00:05 -0400, Biju wrote:



 It would be good if we can also get the same at server side when user
 upload a file using form with file controls
 ie, like the suggestion at
 https://bugzilla.mozilla.org/show_bug.cgi?id=549253
 (it works even with javascript disabled)

 Also remember modificationDate can be a time before creationDate on
 windows.
 This is because modificationDate get copied when you copy a file,
 hence it almost shows modificationDate of the actual content.

 creationDate on other hand is file creation time on the
 folder/directory and when you copy a file to a new directory, it will
 be showing the coping time.

 PS, for JS option there is mozilla bug 390776




 I intend to update the File API so that the File object exposes creationDate
 and modificationDate.

You might want to consider making an async getMetadata function; see
discussion ending at [1].  Async because the modification time can
change often, and as a generic all-metadata function because it's easy
to expand and experiment with.  And if you put that right in the File
API, then I can inherit it from the FileSystem API instead of having
to spec it myself ;'.

  Eric

[1] http://lists.w3.org/Archives/Public/public-device-apis/2010Apr/0054.html


Re: [whatwg] New File attributes creationDate, modificationDate and size

2010-05-18 Thread Arun Ranganathan

On 5/18/10 2:45 PM, Eric Uhrhane wrote:

On Fri, May 14, 2010 at 5:05 PM, Arun Ranganathana...@mozilla.com  wrote:
   

On 5/12/10 4:25 AM, Ashley Sheridan wrote:
 

On Wed, 2010-05-12 at 00:05 -0400, Biju wrote:


   

It would be good if we can also get the same at server side when user
upload a file using form with file controls
ie, like the suggestion at
https://bugzilla.mozilla.org/show_bug.cgi?id=549253
(it works even with javascript disabled)

Also remember modificationDate can be a time before creationDate on
windows.
This is because modificationDate get copied when you copy a file,
hence it almost shows modificationDate of the actual content.

creationDate on other hand is file creation time on the
folder/directory and when you copy a file to a new directory, it will
be showing the coping time.

PS, for JS option there is mozilla bug 390776

 


   

I intend to update the File API so that the File object exposes creationDate
and modificationDate.
 

You might want to consider making an async getMetadata function; see
discussion ending at [1].  Async because the modification time can
change often, and as a generic all-metadata function because it's easy
to expand and experiment with.  And if you put that right in the File
API, then I can inherit it from the FileSystem API instead of having
to spec it myself ;'.

   


Right now in our implementation (Fx 3.6.3), we work with files as 
copies, so if the underlying file changes, the case isn't handled.  But 
I agree that having an asynchronous API that is exposed to web content 
will allow more graceful behavior.


I'll take a look at the generic asynchronous all-metatdata function 
and consider adding it to the File object.


-- A*



Re: [whatwg] New File attributes creationDate, modificationDate and size

2010-05-14 Thread Arun Ranganathan

On 5/12/10 4:25 AM, Ashley Sheridan wrote:

On Wed, 2010-05-12 at 00:05 -0400, Biju wrote:

   

It would be good if we can also get the same at server side when user
upload a file using form with file controls
ie, like the suggestion at https://bugzilla.mozilla.org/show_bug.cgi?id=549253
(it works even with javascript disabled)

Also remember modificationDate can be a time before creationDate on windows.
This is because modificationDate get copied when you copy a file,
hence it almost shows modificationDate of the actual content.

creationDate on other hand is file creation time on the
folder/directory and when you copy a file to a new directory, it will
be showing the coping time.

PS, for JS option there is mozilla bug 390776
 
   


I intend to update the File API so that the File object exposes 
creationDate and modificationDate.


-- A*


Re: [whatwg] New File attributes creationDate, modificationDate and size

2010-05-12 Thread Ashley Sheridan
On Wed, 2010-05-12 at 00:05 -0400, Biju wrote:

 It would be good if we can also get the same at server side when user
 upload a file using form with file controls
 ie, like the suggestion at https://bugzilla.mozilla.org/show_bug.cgi?id=549253
 (it works even with javascript disabled)
 
 Also remember modificationDate can be a time before creationDate on windows.
 This is because modificationDate get copied when you copy a file,
 hence it almost shows modificationDate of the actual content.
 
 creationDate on other hand is file creation time on the
 folder/directory and when you copy a file to a new directory, it will
 be showing the coping time.
 
 PS, for JS option there is mozilla bug 390776


You can get the same on the server side. how you get it just varies from
language to language though, and obviously the exact file information
available is dependant on the file system in use, i.e. fat32, ntfs,
ext3, reiserfs, etc.

Thanks,
Ash
http://www.ashleysheridan.co.uk




[whatwg] New File attributes creationDate, modificationDate and size

2010-05-11 Thread J Ross Nicoll

Looking at http://www.w3.org/TR/2009/WD-FileAPI-20091117/#dfn-file

There doesn't appear to be anyway of retrieving creation date, 
modification date or size of the file. Could I suggest adding attributes 
creationDate, modificationDate and size to provide this information?


For a use case; we're working an a student coursework submission system, 
where they'll be able to drag and drop files. It would be useful to show 
the student details of the file they're uploading (for example, 
modification date is useful to confirm they're uploading the most recent 
version). We do actually see a fairly large number of mis-uploads with 
the existing upload system, and are hoping exposing more information 
during the upload (rather than once the file is received) will help.


Re: [whatwg] New File attributes creationDate, modificationDate and size

2010-05-11 Thread Perry Smith

On May 11, 2010, at 3:43 AM, J Ross Nicoll wrote:

 Looking at http://www.w3.org/TR/2009/WD-FileAPI-20091117/#dfn-file
 
 There doesn't appear to be anyway of retrieving creation date, modification 
 date or size of the file. Could I suggest adding attributes creationDate, 
 modificationDate and size to provide this information?
 
 For a use case; we're working an a student coursework submission system, 
 where they'll be able to drag and drop files. It would be useful to show the 
 student details of the file they're uploading (for example, modification date 
 is useful to confirm they're uploading the most recent version). We do 
 actually see a fairly large number of mis-uploads with the existing upload 
 system, and are hoping exposing more information during the upload (rather 
 than once the file is received) will help.

I was just going to ask the same question.  My use case is for a progress bar.  
As I parse a file, it would be nice to have a progress bar based upon the file 
size and how much has been parsed.



Re: [whatwg] New File attributes creationDate, modificationDate and size

2010-05-11 Thread Olli Pettay

On 5/11/10 11:43 AM, J Ross Nicoll wrote:

Looking at http://www.w3.org/TR/2009/WD-FileAPI-20091117/#dfn-file

Note, discussion about FileAPI should happen in WebApps WG mailing list.




There doesn't appear to be anyway of retrieving creation date,
modification date or size of the file.

You can get the size from Blob. And File extends Blob.

-Olli


 Could I suggest adding attributes

creationDate, modificationDate and size to provide this information?

For a use case; we're working an a student coursework submission system,
where they'll be able to drag and drop files. It would be useful to show
the student details of the file they're uploading (for example,
modification date is useful to confirm they're uploading the most recent
version). We do actually see a fairly large number of mis-uploads with
the existing upload system, and are hoping exposing more information
during the upload (rather than once the file is received) will help.





Re: [whatwg] New File attributes creationDate, modificationDate and size

2010-05-11 Thread John Tamplin
On Tue, May 11, 2010 at 4:43 AM, J Ross Nicoll j...@jrn.me.uk wrote:

 Looking at http://www.w3.org/TR/2009/WD-FileAPI-20091117/#dfn-file

 There doesn't appear to be anyway of retrieving creation date, modification
 date or size of the file. Could I suggest adding attributes creationDate,
 modificationDate and size to provide this information?


Note that not all filesystems the server might be using keep creation date,
and there are different granularities for modification date.

-- 
John A. Tamplin
Software Engineer (GWT), Google


Re: [whatwg] New File attributes creationDate, modificationDate and size

2010-05-11 Thread Jonas Sicking
On Tue, May 11, 2010 at 11:31 AM, Olli Pettay olli.pet...@helsinki.fi wrote:
 On 5/11/10 11:43 AM, J Ross Nicoll wrote:

 Looking at http://www.w3.org/TR/2009/WD-FileAPI-20091117/#dfn-file

 Note, discussion about FileAPI should happen in WebApps WG mailing list.



 There doesn't appear to be anyway of retrieving creation date,
 modification date or size of the file.

 You can get the size from Blob. And File extends Blob.

Indeed. A progress bar is implementable using the features already
specced in File and FileReader.

As for the creationDate and modificationDate, this seems ok to me. I'm
as always somewhat concerned about privacy, but I think on the whole
it would be ok.

/ Jonas


Re: [whatwg] New File attributes creationDate, modificationDate and size

2010-05-11 Thread Biju
It would be good if we can also get the same at server side when user
upload a file using form with file controls
ie, like the suggestion at https://bugzilla.mozilla.org/show_bug.cgi?id=549253
(it works even with javascript disabled)

Also remember modificationDate can be a time before creationDate on windows.
This is because modificationDate get copied when you copy a file,
hence it almost shows modificationDate of the actual content.

creationDate on other hand is file creation time on the
folder/directory and when you copy a file to a new directory, it will
be showing the coping time.

PS, for JS option there is mozilla bug 390776