Warning: ftp_put() [function.ftp-put]: open_basedir restriction in effect. File(C:\Windows\Temp\phpAA36.tmp) is not within the allowed path(s): (D:\Plesk\VHOSTS\oceanstravel.co.uk\gds-admin-dctp\) in D:\Plesk\VHOSTS\oceanstravel.co.uk\gds-admin-dctp\see.php on line 27
Warning: ftp_put(C:\Windows\Temp\phpAA36.tmp) [function.ftp-put]: failed to open stream: Operation not permitted in D:\Plesk\VHOSTS\oceanstravel.co.uk\gds-admin-dctp\see.php on line 27
$local_file = $_FILES['txt_file']['tmp_name']; // Defines Name of Local File to be Uploaded
$destination_file = "".basename($_FILES['txt_file']['name']); // Path for File Upload (relative to your login dir)
// Global Connection Settings
$ftp_server = "99.111.852.87"; // FTP Server Address (exlucde ftp://)
$ftp_user_name = "user"; // FTP Server Username
$ftp_user_pass = "pass}"; // Password
// Connect to FTP Server
$conn_id = ftp_connect($ftp_server);
// Login to FTP Server
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
// Verify Log In Status
if ((!$conn_id) || (!$login_result)) {
echo "FTP connection has failed! <br />";
echo "Attempted to connect to $ftp_server for user $ftp_user_name";
exit;
} else {
echo "Connected to $ftp_server, for user $ftp_user_name <br />";
}
$upload = ftp_put($conn_id, $destination_file, $local_file, FTP_BINARY); // Upload the File
// Verify Upload Status
if (!$upload) {
echo "<h2>FTP upload of ".$_FILES['txt_file']['name']." has failed!</h2><br /><br />";
} else {
echo "Success!<br />" . $_FILES['txt_file']['name'] . " has been uploaded to " . $ftp_server . $destination_file . "!<br /><br />";
}
ftp_close($conn_id); // Close the FTP Connection
}
?>
<!-- Link to progress file: see http://www.ajaxload.info/ for animated gifs -->
<img id="progress" src="http://www.webite.co.uk/Search-Result/loading.gif" />
<p id="prog_text" style="display:inline;"> Upload Started!</p>
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Bookmarks