Re: FTP question

From: Richard Hulbert (richard_at_richardhulbert.com)
Date: 02/24/04


Date: Tue, 24 Feb 2004 09:24:16 +0000

On 2004-02-23 19:06:53 +0000, Pedro Graca <hexkid@hotpop.com> said:

> Are you sure that is what you want?
>
>
> What exact error do you get? At which instruction?
>
> This is like asking us to guess what is the license plate on your car
> just be telling us it's a FOOBAR model!
> -- --= my mail box only accepts =--
> --= Content-Type: text/plain =--
> --= Size below 10001 bytes =--
>
Firstly Thanks for answering.
 
Ok Sorry let me step back a bit. firstly here is what i am trying to do:

I am building a CMS that needs to upload two supporting files to
directories on the public server. I want to do this from another site, at
the moment I am doing this from localhost on my dev machine.

I thought FTP option would be better in terms of preventing php actually
writing files to the server.

Ok so the Error - I don't get an error as such, i connect in, can navigate
directories,etc it is the last call that is giving me a problem.

if (ftp_put($conn_id, $remote_file, $file, FTP_BINARY)) {
 echo "successfully uploaded $file\n";
 } else {
 echo "There was a problem while uploading $file\n";
 }

now $remote file is a string right? somthing like /music/previews/abc.mp3
and $file is from $file = $_FILES['userfile']['name'];

basically ftp_put fails and I Echo There was a problem...

am i missunderstanding how to use the $_FILES object in this context?

thanks Richard



Relevant Pages

  • Possible bug? Strange problem trying to return a value from a function
    ... when the file already exists in the upload directory, ... echo $row." ... throw new Exception ("Unable to move file to upload directory. ...
    (comp.lang.php)
  • Re: file upload problem
    ... I am trying to learn about uploading files with php. ... I made a simple form script and and file up load script. ... The form script gets the file name correctly and seems to pass it to the upload script correctly. ... if I echo ini_getI see ...
    (comp.lang.php)
  • Re: file upload problem
    ... I am trying to learn about uploading files with php. ... I made a simple form script and and file up load script. ... The form script gets the file name correctly and seems to pass it to the upload script correctly. ... if I echo ini_getI see ...
    (comp.lang.php)
  • Re: file upload problem
    ... I am trying to learn about uploading files with php. ... I made a simple form script and and file up load script. ... The form script gets the file name correctly and seems to pass it to the upload script correctly. ... if I echo ini_getI see ...
    (comp.lang.php)
  • File upload -- completed but with errors :--)
    ... completed PHP script for file upload. ... echo 'Photo is GIF '; ...
    (comp.lang.php)