FTP Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationFTP Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old September 15th, 2003, 09:40 AM
dpwhitedp dpwhitedp is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 25 dpwhitedp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 22 sec
Reputation Power: 0
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??

Reply With Quote
  #2  
Old September 15th, 2003, 09:45 AM
drgroove's Avatar
drgroove drgroove is offline
pushing envelopes, not pencils
Dev Shed God 2nd Plane (6000 - 6499 posts)
 
Join Date: Feb 2002
Posts: 6,224 drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Day 4 h 34 m 57 sec
Reputation Power: 174
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


Reply With Quote
  #3  
Old September 15th, 2003, 09:52 AM
dpwhitedp dpwhitedp is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 25 dpwhitedp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 22 sec
Reputation Power: 0
<?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);

?>

Reply With Quote
  #4  
Old September 15th, 2003, 10:00 AM
drgroove's Avatar
drgroove drgroove is offline
pushing envelopes, not pencils
Dev Shed God 2nd Plane (6000 - 6499 posts)
 
Join Date: Feb 2002
Posts: 6,224 drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Day 4 h 34 m 57 sec
Reputation Power: 174
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 ?

Reply With Quote
  #5  
Old September 15th, 2003, 10:11 AM
dpwhitedp dpwhitedp is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 25 dpwhitedp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 22 sec
Reputation Power: 0
i did and it appends the total path to the path ending ftp.php.

the get statement is line 10.

Reply With Quote
  #6  
Old September 15th, 2003, 10:18 AM
drgroove's Avatar
drgroove drgroove is offline
pushing envelopes, not pencils
Dev Shed God 2nd Plane (6000 - 6499 posts)
 
Join Date: Feb 2002
Posts: 6,224 drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Day 4 h 34 m 57 sec
Reputation Power: 174
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 ?

Reply With Quote
  #7  
Old September 15th, 2003, 10:20 AM
dpwhitedp dpwhitedp is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 25 dpwhitedp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 22 sec
Reputation Power: 0
it is in this directory, I can see it with ftp-pro

Reply With Quote
  #8  
Old September 15th, 2003, 10:32 AM
drgroove's Avatar
drgroove drgroove is offline
pushing envelopes, not pencils
Dev Shed God 2nd Plane (6000 - 6499 posts)
 
Join Date: Feb 2002
Posts: 6,224 drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Day 4 h 34 m 57 sec
Reputation Power: 174
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationFTP Help > ftp_get


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway