Start function - I get $ftp connection fine, ftp_chdir into the remote directory where the file lives, all ok to here...
generate random crap...
srand((double)microtime()*1000000);
$randval = rand();
I'm putting in trims in the off chance white space was a prob, unlikely though.. $ftp_tmpdir in this case is "C:\TEMP"
$tmpfile=$ftp_tmpdir."\\".trim($select_file).".".trim($randval);
...and wham ! No sorry "Error opening filewhatever.txt" !!
if(!ftp_get($ftp,$tmpfile,$select_file,FTP_ASCII)){
ftp_quit($ftp);
So it never even gets any further - I'm stumped !!and its only one line of code !!
Heres the file test stuff which I just did to see if its an issue with reading/writing on local os - seems to be as this executes the else statement every time even though the file DOES exist !!
if (file_exists($filename)){
print "The file $filename exists";
ftp_put($ftp_conn,"/TestDir/testfile.txt","c:\log.txt",FTP_ASCII);
}else{
print "The file $filename does not exist";
If you think of anything that might be causing this please let me know !!!
Thanks man,
Tyson.