0

my system uses a XML file generated by a URL and I need a script that every 30 minutes access that URL (https://www.shopfisio.com.br/feeds/teste-leo?download=true), and download the file to my server directory.

Can somebody help me how to do this?

2
  • What have you tried to do? Any code samples? Commented Jul 5, 2018 at 2:59
  • you can run cron job for every 30 minutes Commented Jul 5, 2018 at 3:06

2 Answers 2

1

In a simple case you can use following code:

<?php $xml = file_get_contents('https://www.shopfisio.com.br/feeds/teste-leo?download=true'); file_put_contents('import.xml', $xml); 

For scheduling execution of your script you might use cron.

Sign up to request clarification or add additional context in comments.

Comments

0

You can create a cron job entry that run a script every 30 minutes. In the script you should use CURL, Or just use package like guzzle to create a request to the url and save the returning body into a file on your server by one of read&write like file_put_contents files functions in php, hope thats help you.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.