PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Fair point...
I'm uploading to an ISA server, will this make a difference?
<?php
$ftp_server="removedforsecurityreasons";
$ftp_user_name="removedforsecurityreasons";
$ftp_user_pass="removedforsecurityreasons";
$file = 'example.jpg';
$remote_file = 'test_h.jpg';
// Open FTP 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 the connection
if ((!$conn_id) || (!$login_result)) {
echo "FTP connection has failed!";
echo "Attempted to connect to $ftp_server for user $ftp_user_name";
exit;
} else {
echo "Connected successfully to $ftp_server, under username $ftp_user_name";
}
// upload a file
if (ftp_put($conn_id, $remote_file, $file, FTP_BINARY)) {
echo "<br>successfully uploaded $file\n, retitled it $remote_file";
} else {
echo "<br>There was a problem while uploading $file\n";
}
// Close the FTP connection
ftp_close($conn_id);
?>
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
supplying a full path to whatever file you wish to upload will allow you to upload any file from anywhere in the system (privileges withstanding.) As for not being able to upload images, I don't see anything that would make such a behaviour happen. Maybe it's something on that server's end of things?