corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » PHP FTP help ASAP please :)


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author PHP FTP help ASAP please :)
Antz
Member

Registered: 28th Jul 03
Location: Leeds         Drives: Myself Insane!
User status: Offline
8th Jan 07 at 15:11   View User's Profile U2U Member Reply With Quote

Nooow then...

Just done some coding to make a php page run as an FTP client...

The obvious problem I've run into is... the php page will only take a source file from the server it's based on... not a local machine...

kinda defeats the object of it been FTP software :S

Heres my code... is there anything I can do to it to make it pull files from my machine and poist them via the FTP onto a remote server?

code:

<?php
// set up basic connection
$conn_id = ftp_connect($ftp_server);

// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);

// check connection
if ((!$conn_id) || (!$login_result)) {
echo "Upload Failed<BR>";
echo "Attempted to Upload Video<BR>";
exit;
} else {
echo "Uploading...<BR>";
}

// upload the file
$upload = ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY);

// check upload status
if (!$upload) {
echo "Video Upload Failed<BR>";
} else {
echo "Uploaded $source_file Complete!<BR>";
}

// close the FTP stream
ftp_close($conn_id);
?>



[Edited on 08-01-2007 by Antz]
andy.ros
Member

Registered: 23rd Aug 04
Location: Lancaster, Lancashire
User status: Offline
8th Jan 07 at 18:12   View User's Profile U2U Member Reply With Quote

http://www.tizag.com/phpT/fileupload.php

could try that?

 
New Topic

New Poll

  Related Threads Author Forum Replies Views Last Post
NTL Broadband Users Phil321 Geek Day 2 657
3rd Jan 04 at 19:08
by Adam-D
 
anyone use 1and1 webhostin??......nismo get in here! Icy Geek Day 22 783
28th Dec 04 at 16:22
by Icy
 
How do I go about making a CRON job to do these 2 commands??? PaulW Geek Day 10 885
12th Jan 06 at 19:05
by PaulW
 
Uploading files via ftp on IE 7 or Firefox Rich H Geek Day 8 863
27th Jun 06 at 22:34
by ZetecRob
 

Corsa Sport » Message Board » Off Day » Geek Day » PHP FTP help ASAP please :) 28 database queries in 0.0103350 seconds