[Mayan EDMS: 2105] retaining file modification date of an uploaded file

classic Classic list List threaded Threaded
3 messages Options
Ben
Reply | Threaded
Open this post in threaded view
|

[Mayan EDMS: 2105] retaining file modification date of an uploaded file

Ben
Hi,

Is there any way to access or save the modification date of an uploaded file? I need to upload thousands of old documents and I am using a watch folder for it. The upload works fine but the document timestamp is the time when the document was added to Mayan.
It would be nice to have the modification date of the file to filter  searches.
I cannot find anything in Django: The UploadedFile class has only a few attributes  ( name, size, ... ) but no modification date.

Ben

--

---
You received this message because you are subscribed to the Google Groups "Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Mayan EDMS: 2105] retaining file modification date of an uploaded file

rosarior
Administrator
Hi,

Yes, I think creation and last modification date are only readable via filesystem calls in Python. I'll take a look at all the internal to see if this is true. If the dates are somehow available they can be added as two extra fields in the document version model with no compatibility issues. 

On Sep 13, 2017 12:17 PM, "Ben" <[hidden email]> wrote:
Hi,

Is there any way to access or save the modification date of an uploaded file? I need to upload thousands of old documents and I am using a watch folder for it. The upload works fine but the document timestamp is the time when the document was added to Mayan.
It would be nice to have the modification date of the file to filter  searches.
I cannot find anything in Django: The UploadedFile class has only a few attributes  ( name, size, ... ) but no modification date.

Ben

--

---
You received this message because you are subscribed to the Google Groups "Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Ben
Reply | Threaded
Open this post in threaded view
|

Re: [Mayan EDMS: 2106] retaining file modification date of an uploaded file

Ben
Thanks Roberto for this info.
I will try to add the timestamp (from getmtime)  to the filename, put them in the watch folder, split the filenames after an upload to get the timestamp and add an extra field in the document version model. Maybe not the most elegant way but it is only for the initial bulk upload, for new documents the users have to add it manually through metadata.

Ben

On Wednesday, 13 September 2017 18:44:27 UTC+2, Roberto Rosario wrote:
Hi,

Yes, I think creation and last modification date are only readable via filesystem calls in Python. I'll take a look at all the internal to see if this is true. If the dates are somehow available they can be added as two extra fields in the document version model with no compatibility issues. 

On Sep 13, 2017 12:17 PM, "Ben" <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="V57LsZusAQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">ma...@...> wrote:
Hi,

Is there any way to access or save the modification date of an uploaded file? I need to upload thousands of old documents and I am using a watch folder for it. The upload works fine but the document timestamp is the time when the document was added to Mayan.
It would be nice to have the modification date of the file to filter  searches.
I cannot find anything in Django: The UploadedFile class has only a few attributes  ( name, size, ... ) but no modification date.

Ben

--

---
You received this message because you are subscribed to the Google Groups "Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="V57LsZusAQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mayan-edms+...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.