FTP Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

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:
  #1  
Old January 18th, 2002, 04:36 PM
jjoske jjoske is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Posts: 286 jjoske User rank is Lance Corporal (50 - 100 Reputation Level)jjoske User rank is Lance Corporal (50 - 100 Reputation Level)jjoske User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 3 Days 5 h 24 m 46 sec
Reputation Power: 12
Angry ftp_put error

I'm getting this when warning when I try the use the ftp_put command. It is : ftp_put: PORT command successful. in /......../web.cls.php on line 394. Every thing was working fine until a couple of days ago when it just stopped working.
The connection seems to be opening ok, and then it hangs when trying to right the file.
Can any one point me in the right direction of what is going wrong?

Reply With Quote
  #2  
Old January 18th, 2002, 06:25 PM
AlCapone's Avatar
AlCapone AlCapone is offline
Mobbing Gangster
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Sep 2001
Location: "Best City" 2002 and 2003- Melbourne, Australia
Posts: 4,912 AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 5 h 36 m 31 sec
Reputation Power: 31
Send a message via ICQ to AlCapone Send a message via AIM to AlCapone Send a message via Yahoo to AlCapone
ftp_put: PORT command successful. in /......../web.cls.php on line 394
so you get that echoed when try to upload file? Does the file get uploaded? Weird, PORT is sort of alternative of PASS, and the difference between two is in the way how they do listing of dirs - somewhat different methods of getting info. Both of them have not much to do with file uploading, so you'll have to show some code.
__________________
And you know I mean that.

Reply With Quote
  #3  
Old January 18th, 2002, 06:36 PM
jjoske jjoske is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Posts: 286 jjoske User rank is Lance Corporal (50 - 100 Reputation Level)jjoske User rank is Lance Corporal (50 - 100 Reputation Level)jjoske User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 3 Days 5 h 24 m 46 sec
Reputation Power: 12
Heres the code I'm using, two days ago it was working fine:

function upload($page,$pageName)
{
//connect to remote host
if(!($this->filetp=ftp_connect($this->ftp->host)))
{
print"ftp error";
die;
}
if(!ftp_login($this->filetp,$this->ftp->login,$this->ftp->password))
{
print'login error<br>';
}

//create a temp. file
if(!$file=fopen("temp".$this->id,"w")) {
print"error creating page $pageName<br>";
die;
}

fputs($file,$page);
fclose($file);
if(!ftp_put($this->filetp,$this->ftp->path."/$pageName","temp".$this->id, FTP_ASCII)) {
print"error putting $pageName<br>";
die;
}

//delete temp file
unlink("temp".$this->id);

//close ftp connection
ftp_quit($this->filetp);
}


It creates the temp file no problems and even creates the file on the server it is uploading to. The Uploaded file is empty though

Reply With Quote
  #4  
Old January 18th, 2002, 06:47 PM
AlCapone's Avatar
AlCapone AlCapone is offline
Mobbing Gangster
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Sep 2001
Location: "Best City" 2002 and 2003- Melbourne, Australia
Posts: 4,912 AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 5 h 36 m 31 sec
Reputation Power: 31
Send a message via ICQ to AlCapone Send a message via AIM to AlCapone Send a message via Yahoo to AlCapone
Your logic is not very clear here, but lets go step by step.
For debuging purposes let $this->id be 12. Your code does create temp12 file on hdd in the same dir as php file and file does have something in it. Then it uploads temp file to ftp, but it is empty there. By what name does it upload?

Reply With Quote
  #5  
Old January 18th, 2002, 06:51 PM
jjoske jjoske is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Posts: 286 jjoske User rank is Lance Corporal (50 - 100 Reputation Level)jjoske User rank is Lance Corporal (50 - 100 Reputation Level)jjoske User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 3 Days 5 h 24 m 46 sec
Reputation Power: 12
the uploaded page name is $pageName, for example index.php.

Reply With Quote
  #6  
Old January 18th, 2002, 07:23 PM
AlCapone's Avatar
AlCapone AlCapone is offline
Mobbing Gangster
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Sep 2001
Location: "Best City" 2002 and 2003- Melbourne, Australia
Posts: 4,912 AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 5 h 36 m 31 sec
Reputation Power: 31
Send a message via ICQ to AlCapone Send a message via AIM to AlCapone Send a message via Yahoo to AlCapone
Uhm. I do see one problem in your problem. Why bother uploading files anyway? Why don't you just write $page into $pageName without using extra ftp connection? I mean, couldn't you just use fopen and fputs? That'll make things faster and easier...

Reply With Quote
  #7  
Old January 18th, 2002, 08:18 PM
jjoske jjoske is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Posts: 286 jjoske User rank is Lance Corporal (50 - 100 Reputation Level)jjoske User rank is Lance Corporal (50 - 100 Reputation Level)jjoske User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 3 Days 5 h 24 m 46 sec
Reputation Power: 12
That could be a better solution, I'll give it a try thanks for the help.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationFTP Help > ftp_put error

Developer Shed Advertisers and Affiliates



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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap