Reputation: 7289
I can copy the file directly to my server when available:
copy("http://source.com/file.mp3", "newfile.mp3");
I need to know when the file is available by getting other file info such as last modified so I can compare the files and copy the new file(s) only when they are updated. This works fine on my server, but not for an external source, is there an alternative?
echo filemtime($externalfile);
echo filectime($externalfile);
echo print_r(stat($externalfile));
Is it a security restriction to disallow access to this information?
I have access to the directory listing as a page, as a last resort I could access the last modified and sizes from that, but a direct solution would be better.
Upvotes: 3
Views: 3094
Reputation: 30180
If i understand your question correctly you can try using get_headers and looking for the last-modified portion...
Or you could use the content-length header and compare it to the size of the current weeks mp3
Upvotes: 5