|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
ftp_get
my get statement:
ftp_get($ftp_id, $local_file, $server_file, FTP_BINARY) $server_file is called pdf2.pdf I get error: Warning: ftp_get: pdf2.pdf: No such file or directory in /home/david/data-www/ftp.php on line 10 There was a problem it is putting ftp.php (my script) in the path. Why?? |
|
#2
|
||||
|
||||
|
Can you show us the rest of your code?
__________________
Give a person code, and they'll hack for a day; Teach them how to code, and they'll hack forever. Analyze twice; hack once. The world's first existential ITIL question: If a change is released into production without a ticket to track it, was it actually released? About DrGroove: ITIL-Certified IT Process Engineer - Enterprise Application Architect - Freelance IT Journalist - Devshed Moderator - Funk Bassist Extraordinaire |
|
#3
|
|||
|
|||
|
<?php
here is my code: $local_file = "c:\temp\mypdf.pdf"; $server_file = "pdf2.pdf"; $ftp_id = ftp_connect('ftp.mysite.com'); $login_result = ftp_login($ftp_id, 'user1', 'user1pw'); if (ftp_get($ftp_id, $local_file, $server_file, FTP_BINARY)) { echo "Successfully written to $local_file\n"; } else { echo "There was a problem\n"; } ftp_close($ftp_id); ?> |
|
#4
|
||||
|
||||
|
ftp_get() isn't finding pdf2.pdf
You should try specifing the path that this file is at w/in the filesystem, i.e. "/home/public_html/pdfs/pdf2.pdf" Which line is line 10 ? |
|
#5
|
|||
|
|||
|
i did and it appends the total path to the path ending ftp.php.
the get statement is line 10. |
|
#6
|
||||
|
||||
|
What is the location of the pdf2.pdf in your file system?
/home/david/data-www/ .... Is it in this directory (above)? Or, in a sub-directory w/in this ? |
|
#7
|
|||
|
|||
|
it is in this directory, I can see it with ftp-pro
|
|
#8
|
||||
|
||||
|
dpwhitedp,
I just tested this code on my server, and as long as I specify correct file paths for the local and remote files, it executes flawlessly. Double-check your file path variables. Try using a C:\ instead of c:\. Definitely include the entire path to the .pdf file in the $server_file var. |
![]() |
| Viewing: Dev Shed Forums > System Administration > FTP Help > ftp_get |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|