Jump to content

Ftp Issues - Failed To Open File


ReeceSayer

Recommended Posts

Hi All,

 

I'm trying to set up some code to download a CSV file from an ftp host and then i want to do something with it.

 

However, i can't quite get the code to work. I get the following error:

 

Warning: ftp_get() [function.ftp-get]: Failed to open file. in /home/rsyr/restofthedirectories/ on line 8

 

Here's the code, excuse the messiness:

 

<?php
$today = date("Y-m-d");
$conn = ftp_connect("ftp.zois.co.uk") or die("Could not connect");
ftp_login($conn,"anonymous","");
echo "JCP-scrape-". $today;
echo ftp_get($conn,"JCP-scrape-18-10-2012.csv", "/pub/jcp/JCP-scrape-18-10-2012.csv",  FTP_ASCII);
ftp_close($conn);
//sql code to move data from holding table to vacancy table
//INSERT INTO vacancy (title, jobref, location, description, apply) SELECT title, reference, location, description, apply FROM holdingtable
//truncate holdingtable
//Holding table should then be truncated
?>

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/269682-ftp-issues-failed-to-open-file/
Share on other sites

You apparently copy/pasted the code from some rich-text/formatted source.

 

Please go back and copy/paste just the plain text from your programming editor.

 

It should have changed now i've edited the post, i copied it straight from Notepad++, not sure what the problem was.

 

Thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.