Thanks Jason, I'll try that, and let you know the results. Hugh ----- Original Message ----- From: "Jason Wong" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> 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 > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php