Re: FTP Can't create temp file?

From: Date: Mon, 16 Dec 2002 17:52:35 +0000
Subject: Re: FTP Can't create temp file?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-128439@lists.php.net to get a copy of this message
What happens when you remove the suppresion operator (@) from the move_upload_file and why not just use ftp_put()? That has always worked fine for me. ----- Original Message ----- From: "Marios Adamantopoulos" <mario@tonic.co.uk> To: <php-general@lists.php.net> Sent: Monday, December 16, 2002 11:06 AM Subject: [PHP] FTP Can't create temp file? > > Hi all again > > I'm trying to upload to a unix server. The program I use works fine on my > 2000 IIS machine but it has a problem on the online one. Permittions have > been checked and I've been looking all day to find something, but natha... > > I would appreciate it if someone can have a look and suggest something. Here > is the script: > > > $conn_id = ftp_connect($ftpServer); > $login_result = ftp_login($conn_id, $ftpUser, $ftpPass); > if ((!$conn_id) || (!$login_result)) { > echo "FTP connection has failed!"; > echo "Attempted to connect to $ftpServer for user $ftpUser"; > exit; > } else { > //echo "Connected to $ftpServer, for user $ftpUser"; > } > > > $phpftp_dir = ""; > > echo "<br>--" . ftp_pwd($conn_id) . "<br>"; > > > $phpftp_tmpdir="/tmp"; > > > srand((double)microtime()*1000000); > $randval = rand(); > $tmpfile=$phpftp_tmpdir . "/" . $thefile_name . "." . $randv; > > echo "Temp file: " . $tmpfile . "<br>"; > > > if (!@move_uploaded_file($thefile,$tmpfile)) { > echo "Upload failed! Can't create temp file"; > } else { > ftp_chdir($conn_id,$phpftp_dir); > ftp_put($conn_id,$thefile_name,$tmpfile,FTP_BINARY); > //ftp_quit($conn_id); > unlink($tmpfile); > } > > --- > I always get: "Upload failed! Can't create temp file" > > Thank you guys in advance > > Mario > > > > _________________________ > 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. > ............................................................................ > .................................... >

« previous php.general (#128439) next »