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:
  #1  
Old April 10th, 2003, 04:52 PM
lukathonic lukathonic is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 1 lukathonic User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
file upload problem - Warning: ftp_put(): error opening ...

I'm writing an upload script to upload directly to a remote server. It seems to connect ok but I can't 'put' the file.
This is the error:
Warning: ftp_put(): error opening in /home/virtual/site279/fst/var/www/html/fileupload3/upload.php on line 24

Here is my code
<?php
$ftp_server="glasswing.com";
$conn_id = ftp_connect($ftp_server);
$user="XXX";
$passwd="FOO";
$login_result = ftp_login($conn_id, $user, $passwd);
if ((!$conn_id) || (!$login_result)) {
echo "FTP connection has failed!";
echo "Attempted to connect to $ftp_server for user $ftp_user_name";
die;
} else {
echo "Connected to $ftp_server, for user $user";
}
//directorylike /www.velibaba.com/images
//ftp_chdir($conn_id, "www.velibab.com");
//ftp_chdir($conn_id, "compimages");
//$destination_file=ftp_pwd($conn_id);
$destination_file="x.jpg";
echo ("");
print $destination_file;
echo ("");
// upload the file
$source_file = $_POST['userfile'];
$upload = ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY);
// check upload status
if (!$upload) {
} else {
echo "Uploaded $source_file to $ftp_server as $destination_file";
}
// close the FTP stream
ftp_close($conn_id);
?>

Thanks!

Reply With Quote
  #2  
Old April 10th, 2003, 08:09 PM
colpaarm's Avatar
colpaarm colpaarm is offline
300lb Bench!
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Aug 2001
Location: New York
Posts: 2,191 colpaarm User rank is Corporal (100 - 500 Reputation Level)colpaarm User rank is Corporal (100 - 500 Reputation Level)colpaarm User rank is Corporal (100 - 500 Reputation Level)colpaarm User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 5 h 8 m 19 sec
Reputation Power: 12
Have you checked out this link?

http://www.php.net/manual/en/function.ftp-put.php

Try the suggestions on that page. Hopefully that will help you.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationFTP Help > file upload problem - Warning: ftp_put(): error opening ...


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