Jump to content
luc154

modification time does not change

Recommended Posts

Im running a site and have a problem.

Visitors can download sermons and can see when the sermon was preached.

The problem is that everytime I upload a sermon I have to mannually insert the date of the file into the code.

Even if I manually edit the date of the file (last modification date) on my pc.

When I upload the file to the server it automatically takes on the current date.

I tried the touch function and filemtime function but to no avail. The time keeps ticking and is not static.

The whole idea is that I change the modification time on my pc and just upload the sermon and then on the server through code get the time the file was last modified. And that would be the date the sermon was preached.

 

 

Share this post


Link to post
Share on other sites

Yes, the OS has control of lastmtime. Whenever something is changed on a filesystem, THAT filesystems OS sets the lastmodtime. So if you upload a file to a server, that servers OS is updating the file on the filesystem so it automatically changes the lastmtime.

 

Perhaps a better way would be to name your files to contain the date of the sermon, and use that as that won't change when uploading.

 

2015-04-25-sermon-name.mp4

2014-08-25-sermon-name.mp4

Share this post


Link to post
Share on other sites

Thank you. If there is no other way then that would be the last resort.

Share this post


Link to post
Share on other sites

There is software called rsync that is very good for synchronizing data between 2 servers. I'd recommend looking at that, and using rsync to move files from your workstation up to the server.

Share this post


Link to post
Share on other sites

I nice way to do this might be to create a sermon management console with uploader where you can specify the date and time you want. As the upload is being saved, you would save the path to the file, and any other details (like the date and time, name of pastor, topic, etc) in a database table (sermons_data). Later, if you decide to change anything about the sermon, you would just go back to your console and make the edit.

 

Although wretched as an application, WordPress as a CMS using custom post types would handle this well for you. Even if nobody ever sees the WordPress app, you could just use it to populate a database, and then pull in the content through custom queries. I do this a lot because WordPress is a bloated hog.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.