Hi all 
I have a problm uploading a simple file to my server using the PHP FTP
functions.
I would appreciate it if anyone could help:

The HTML part:

<form enctype="multipart/form-data" action="ftp.php" method="post"
name="FormName">
Upload file : 
<input type="file" name="thefile" size="24" border="0">
<input type="hidden" name="phpftp_dir" value ="<? echo $phpftp_dir?>"
size="24" border="0">
<input type="submit" name="submitButtonName" value="Upload" border="0">
</form>

The PHP:
(which gives me the error: (Warning: error opening
C:\Inetpub\wwwroot\mario\phpftp\phpftp\FTPonline\12.txt in
/home/virtual/site490/fst/var/www/html/ftp/ftp.php on line 90 - the line
with the ftp_put() function)


        $picture = "thefile_name";
        $picture1 = $$picture;
        $theimage = $picture1;

        $source_file =
"C:\\Inetpub\\wwwroot\\mario\\phpftp\\phpftp\\FTPonline\\" . $theimage;
        
        $destination_file = "/var/www/html/ftp/" . $theimage;
        
        $upload = ftp_put($conn_id, $destination_file, $source_file,
FTP_BINARY); 


        // check upload status
        if (!$upload) { 
                echo "<br>FTP upload has failed!";
        } else {
                echo "<br>Uploaded $source_file to $ftpServer as
$destination_file";
        }

_________________________
Marios Adamantopoulos
Senior Developer

Tonic
+44 (0)20 7691 2227
+44 (0)7970 428 372
www.tonic.co.uk

Recent projects
www.polydor.co.uk
www.adcecreative.org
www.sony-europe.com/pocketlife
............................................................................
....................................
Opinions, conclusions and other information in this message that do not
relate to the official business of Tonic Design Limited shall be
understood as neither given nor endorsed by them.
............................................................................
....................................


-----Original Message-----
From: Chris Hewitt [mailto:[EMAIL PROTECTED]] 
Sent: 16 December 2002 11:54
To: Miguel González Castaños; [EMAIL PROTECTED]
Subject: Re: [PHP] Re: Mail() Not working right


Miguel González Castaños wrote:

>I am testing the php mail function with the typical script
>
>$mailsuccess = mail(...);
>if (!$mailsuccess) {
>echo "Mail could not be sent";
>}
>
>In one redhat linux box I got that the email was sent succesfully and 
>in the other box, it cant send it, but the script is executed (no parse 
>errors).
>
>I have sendmail 8.11-2 and php 4.1.2.
>
>As i have said in my other email, I have checked if I have set properly 
>the nobody privileges to execute sendmail and set the smtp and 
>sendmail_path variables in the php.ini.
>
>Do you know how I could figure out what is going on? Any way of 
>debugging or testing?
>
What does the mail log say? Its usually /var/log/maillog. You say that 
the email is not sent, but what error message do you get? I think we 
need to know a little more about the error.

HTH
Chris

>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to