What would be the best method to determine the date of an online file for establishing whether or not the local version is up to date or not?
One method would be setting up a database. The database could, among other things, contain a file’s id and version number. You’d then perform a database check using the file’s id to compare the file’s version number on the database to its local counterpart on the device. If the version on the database is newer, then you’d initiate a download.
This is a good use for the HTTP HEAD verb for network.request() if the file is visible from a web server. HEAD and GET return identical headers, but HEAD doesn’t return the content of the file. You can see when the file was last modified.
Rob
Thank you both. I think the database method is a little beyond what I require, I just need a quick way to check a files time/date-stamp and go from there.
The HTTP HEAD option sounds like what I need in this case, will look into it.
Thanks again
One method would be setting up a database. The database could, among other things, contain a file’s id and version number. You’d then perform a database check using the file’s id to compare the file’s version number on the database to its local counterpart on the device. If the version on the database is newer, then you’d initiate a download.
This is a good use for the HTTP HEAD verb for network.request() if the file is visible from a web server. HEAD and GET return identical headers, but HEAD doesn’t return the content of the file. You can see when the file was last modified.
Rob
Thank you both. I think the database method is a little beyond what I require, I just need a quick way to check a files time/date-stamp and go from there.
The HTTP HEAD option sounds like what I need in this case, will look into it.
Thanks again