<p>How to get a file's creation date or file size, for example this Hello.jpg at <a href="http://www.mywebsite.com/now/Hello.jpg(note" rel="nofollow noreferrer">http://www.mywebsite.com/now/Hello.jpg(note</a>: This URL does not exist)? The purpose of this question is to make my application re-download the files from the any website when it has detected that the website has an updated version of the files and the files in my local folder are out of date. Any ideas?</p>

[{'answer_id': 70803, 'author': 'Vinko Vrsalovic', 'author_id': 5190, 'author_profile': 'https://Stackoverflow.com/users/5190', 'pm_score': 4, 'selected': True, 'text': "<p>If you use the HEAD request it will send the headers for the resource, there you can check the cache control headers which will tell you if the resource has been modified, last modification time, size (content-length) and date. </p>\n\n<pre><code>$ telnet www.google.com 80\nTrying 216.239.59.103...\nConnected to www.l.google.com.\nEscape character is '^]'.\nHEAD /intl/en_ALL/images/logo.gif HTTP/1.0\n\nHTTP/1.0 200 OK\nContent-Type: image/gif\nLast-Modified: Wed, 07 Jun 2006 19:38:24 GMT\nExpires: Sun, 17 Jan 2038 19:14:07 GMT\nCache-Control: public\nDate: Tue, 16 Sep 2008 09:45:42 GMT\nServer: gws\nContent-Length: 8558\nConnection: Close\n\nConnection closed by foreign host.\n</code></pre>\n\n<p>Note that you'll probably have to decorate this basic and easy approach with many heuristics depending on the craziness of each webserver's admin, as each can send whatever headers they like. If they do not provide caching headers (Last-Modified, Expires, Cache-Control) nor Content-Length nor etag, you'd be stuck with redownloading it to test.</p>\n"}, {'answer_id': 70804, 'author': 'VolkerK', 'author_id': 4833, 'author_profile': 'https://Stackoverflow.com/users/4833', 'pm_score': 1, 'selected': False, 'text': '<p>The webserver might send a last-modified and/or etag header for that purpose.\nAnd you might send an if-modified-since header in your request.</p>\n\n<p>see <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html" rel="nofollow noreferrer">http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html</a>\nsections 14.19, 14.25 and 14.29</p>\n'}]
['https://Stackoverflow.com/questions/70782', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']