PHP, Connect to FTP and check for file.?
-
I want to be able to make a php file that can get on the FTP server, and check to see if a file already exists. Thanks.
-
Answer:
<?php // set up basic connection $conn_id = ftp_connect($ftp_server); // login with username and password $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); // get contents of the current directory $contents = ftp_nlist($conn_id, "."); // Find the file in Array $contents //The function checkFileExist() will compare each item in the Array with $targetFileName checkFileExist($contents , $targetFileName); ?>
UpThe0nu... at Yahoo! Answers Visit the source
Related Q & A:
- How to Upload a JSP File to the smart FTP?Best solution by Yahoo! Answers
- How to parse .log file and insert into database in PHP?Best solution by unix.com
- How to upload a file to another server using cURL and PHP?Best solution by Stack Overflow
- How convert .txt file to .Dat file in php?Best solution by Stack Overflow
- How to connect php file to ms access?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.