Jump to content

modification time does not change


luc154

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.

 

 

Link to comment
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

Link to comment
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.

Link to comment
Share on other sites

  • 2 weeks later...

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.