3 Replies - 227 Views - Last Post: 25 May 2019 - 01:09 PM Rate Topic: -----

#1 fdates   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 27-June 09

Fetch Upload Date/Time of Offsite File - Is this possible?

Posted 23 May 2019 - 07:34 AM

Greetings! PHP Newbie here.

I need to be able to determine the modified or upload date of a file that is on another server (uploaded to my Amazon S3 bucket).

So from my Wordpress site (not hosted on Amazon), I'm trying to get the date as to when my file was uploaded to Amazon so as to display the date on my WP site page.

Is this even possible?

It was when the file was on the same server as WP using filemtime(), but it doesn't appear to work on a URL.

TIA

Is This A Good Question/Topic? 0
  • +

Replies To: Fetch Upload Date/Time of Offsite File - Is this possible?

#2 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 15077
  • View blog
  • Posts: 60,210
  • Joined: 12-June 08

Re: Fetch Upload Date/Time of Offsite File - Is this possible?

Posted 23 May 2019 - 07:43 AM

Is the amazon server file publicly accessible, or do you need to log into see it?

If it is publicly accessible I hear this works a little bit better.
https://www.php.net/...get-headers.php
Was This Post Helpful? 1
  • +
  • -

#3 fdates   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 27-June 09

Re: Fetch Upload Date/Time of Offsite File - Is this possible?

Posted 25 May 2019 - 12:57 PM

View Postmodi123_1, on 23 May 2019 - 08:43 AM, said:

Is the amazon server file publicly accessible, or do you need to log into see it?

If it is publicly accessible I hear this works a little bit better.
https://www.php.net/...get-headers.php


Thank you for your reply.

The amazon server isn't publicly accessible, but it is accessible when logged into my site. Once logged in, a user can click on the link I have there to view or download the file. If the user were to log off the site and then try to access the file by URL, it will not permit it.

So within the site itself I'm trying to have the page display the file information at the top of the page to alert users when the file has last been updated.

I will check out the info you provided. Thank you.
Was This Post Helpful? 0
  • +
  • -

#4 fdates   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 27-June 09

Re: Fetch Upload Date/Time of Offsite File - Is this possible?

Posted 25 May 2019 - 01:09 PM

View Postmodi123_1, on 23 May 2019 - 08:43 AM, said:

Is the amazon server file publicly accessible, or do you need to log into see it?

If it is publicly accessible I hear this works a little bit better.
https://www.php.net/...get-headers.php


Tried this out and it WORKS!

Thank you very much!

Rix
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1