Re: File Upload and ftp transfer problem

From: Date: Thu, 27 Mar 2003 21:16:43 +0000
Subject: Re: File Upload and ftp transfer problem
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-141315@lists.php.net to get a copy of this message
Thanks Jason, I'll try that, and let you know the results. Hugh ----- Original Message ----- From: "Jason Wong" <php-general@gremlins.biz> To: <php-general@lists.php.net> Sent: Thursday, March 27, 2003 11:48 AM Subject: Re: [PHP] File Upload and ftp transfer problem > On Friday 28 March 2003 03:16, Hugh Danaher wrote: > > I'm trying to get the following script to ftp transfer an uploaded image > > file so as to get around a file permission problem. The upload portion of > > this works without problem, the ftp portion doesn't spit out any errors > > either, but the file transfered is just the name of the uploaded temp file > > and not the file itself. If I do a filesize() on $file_stream, I get 44K > > (the size of the image uploaded), I then transfer this var to the ftp > > function but what gets ftp and saved as a file is only 14 bytes. The saved > > file has "/tmp/phpDcJSOq" as its entire contents. The upload scrip is > > below. > > It's doing exactly what you're telling it to do. > > $file_stream=$HTTP_POST_FILES['userfile']['tmp_name']; > > This only contains the _name_ of the temporary file which contains the > contents of your uploaded file. > > What you need to do is send the _contents_ of the file pointed to by > $file_stream. Take a look at fread() and/or file(). > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.biz > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > ------------------------------------------ > Search the list archives before you post > http://marc.theaimsgroup.com/?l=php-general > ------------------------------------------ > /* > I do not find in orthodox Christianity one redeeming feature. > - Thomas Jefferson > */ > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#141315) next »