PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi all
Sorry in advance I am newbie.
I'm trying to put together a little php script that will retrieve a file at a http link and then download it to ftp
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Last edited by duke on Wed Sep 20, 2006 8:56 pm, edited 1 time in total.
so where's the problem? ftp function should be able to connect to the server and download the file. The link I posted has a list of the functions you will need to use.
I'm not going to write the code for you, but maybe this will help... here's what you need to do:
connect to the remote server get the file (download it to your server... which is what I'm guessing you mean by "my ftp") close the connection
There should be functions listed on that page to do all three of those things
BUT... these functions will only work if you have ftp access to the remote server... do you have ftp access to the remote server?
OK I see... well I think probably file_get_contents() (or fopen()) would work for that... try it. Use file_get_contents to load the file into variable and then write that variable to a local file... ? I'm not really sure if that would work or not.