Search code examples
javafile-iojava-ioandroid-file

Change Date Authored in file downloaded


I'm downloading a video from a server and store it on android storage. I'm using Android Studio java. Everything is okay but there is a parameter "Date Authored" with a weird value past (a date before the file created).

Here is a detail of that file:

Properties>Details of affected file

This problem occurs randomly. I'm not sure why it happens.

This file detail in which everything is fine:

file with proper properties>Details

EDIT:

After a few research, I found data is not actually wrong it is the date when the particular video is uploaded on the server. So

My question is: Is it possible to download the only video without their meta-data from the server?

For any classification ask me.


Solution

  • MP4 files contain meta-data, such as "Title" and "Date Authored". They are values inside the file.

    File systems also store meta-data about files, such as "Date Created" and "Date Modified". These are maintained by the Operating System (Windows, Linux, ...).

    It seems that the property dialog you're looking at has a quirk. It is always displaying a "Date Authored", even when not found in the file, in which case it defaults the value to be the same as "Date Created".

    It's a quirk of the dialog, and you should just ignore it / learn to live with it.

    But to answer your question: Yes, you can modify the "Date Authored" value, if you have Java code that can read/write the property meta-data of an MP4 formatted file.

    Search the web to see if there is a library for that, if you really feel the need for it. I wouldn't bother.