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:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old March 1st, 2004, 01:28 AM
apla76 apla76 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 1 apla76 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Net::FTP put function problem

I have created a small program that uploads a file to our ftp server but it returns this error:

CGI Error

The specified CGI application misbehaved by not returning a complete set of HTTP headers.

Here is my code:

Code:
#!\xampp\perl\bin\perl.exe

use CGI;
use Net::FTP;
use Carp::Heavy;

$co = new CGI;

$ftphost = "ftp.website.com";
$username = "username";
$password = "password";
$filename = "E:\\Server\\hellocgi.pl";

print $co->header,
		$co->start_html("Test FTP");
		
	if ($ftp = Net::FTP->new($ftphost,Debug=>1)) 
	{
		if (!$ftp->login($username,$password)) {
			print "Invalid username/password",
					$co->end_html;
		} else {
			$ftp->pasv();
			if (!$ftp->put($filename)) {
				print "Error uploading file",
						$co->end_html;
			} else {			
				print "File uploaded",
						$co->end_html;
			}
		}
		$ftp->quit;
	} else {
		print "Cannot connect to host",
		 		$co->end_html;
	}


Our server does not support Perl so i used PAR to create an EXE file which is supported by our site. It seems that the this happens when "$ftp->put($filename)" is executed. What is wrong with my program?

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationFTP Help > Net::FTP put function problem


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 1 hosted by Hostway