Re: FTP UPLOAD
| From: | Andrew Brampton | Date: | Mon, 16 Dec 2002 14:59:33 +0000 |
| Subject: | Re: FTP UPLOAD | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-128406@lists.php.net to get a copy of this message | ||
Well I think the error is telling you whats up
The file
C:\Inetpub\wwwroot\mario\phpftp\phpftp\FTPonline\12.txt
Doesn't exist
Try changing the line to something like this:
$source_file = $HTTP_POST_FILES['thefile']['tmp_name'];
This or
$source_file = $_FILES['userfile']['tmp_name'];
(if you are using the more lastest PHP version)
Hope this helps
Andrew
----- Original Message -----
From: "Marios Adamantopoulos" <mario@tonic.co.uk>
To: <php-general@lists.php.net>
Sent: Monday, December 16, 2002 12:11 PM
Subject: [PHP] FTP UPLOAD
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:g0pae@manordat.demon.co.uk]
Sent: 16 December 2002 11:54
To: Miguel González Castaños; php-general@lists.php.net
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