
January 26th, 2004, 07:00 AM
|
|
Contributing User
|
|
Join Date: Jul 2003
Posts: 81
 
Time spent in forums: 2 h 19 m 22 sec
Reputation Power: 6
|
|
Uploading file thru PHP Script ..
Hello -
I am using this PHP Upload script to upload file on my webspace. Its connects properly but fails to upload file. I am trying to upload test.txt file from my c:\ to my webs wwwroot directory .Can someone have a look and let me know where I am going wrong :
Quote:
<?php
/*
* Uploads screenshots and inserts all of the info into database */
//ftp user info
$username="username";
$password="password";
$host="ftp.mydomain.com";
$path="//wwwroot//test.txt";
//variables to connect and login to ftp
$conn_id = ftp_connect($host);
$login_result = ftp_login($conn_id, $username, $password);
if ((!$conn_id) || (!$login_result))
{
die("Connection to FTP failed!");
}
//upload the file onto the server
$upload = ftp_put($conn_id, $path, "C://test.txt", FTP_BINARY);
if (!$upload)
{
die("FTP upload has failed!");
}
//close ftp connection
ftp_close($conn_id);
?> |
__________________
Rubal Jain
Webspiders Interweb Pvt. Ltd. & Brainus Networks
http://www.it2ecom.com | http://www.brainus.net
Server Management | Dedicated Servers | Reseller Hosting
Experienced, Qualified Techs | 24/7 Support Centers in India
Helm Premium Partners | Email : sales@brainus.net
|