I see a major error in your code!!!!
You have entered the line:
if (!copy($the_file, $path . "/ " . $the_file_name)) {
Do you realize that your filename is actually " image.jpg"?. There is a space character " " in front of the image.jpg!!! So, thats why when you try to get the file using ftp/ssh, you can't.
Just change the line to
if (!copy($the_file, $path . "/" . $the_file_name)) {
(eliminating the space character after the "/".)
Now how do you remove that annoying " image.jpg" file?
well, ftp into your directory. if you are using the console FTP program under a UNIX, do:
(the ftp> is the prompt -- don't type in)
ftp> cd /whatever/directory
ftp> del " image.jpg"
if you are under a ssh login into the system, do:
(% is your prompt. don't type in :-)
% cd /whatever/directory/your/file/is/in
% rm " image.jpg"
again, include the quotes and the leading space character.
make sure you type in the quotes and the first space character after the starting quote. This should remove the file.
about the executable permission. well, when you upload your file, I think the server automatically adds execute permission for user. so ls -l may look like this:
-rwxrw-r-- 1 user group 000 Mon Date H:M uploadedfile.jpg
hope all this helps,
-sridhar