[PHP] file upload question

2003-01-24 Thread Andrew Rench
the following code:





Send this file: 






produces the following after upload:

/var/tmp/phplSTEVp (or php[something-or-other])

When I view that directory, it is empty.

I put togther this simple test script because I was having problems with
similar script that uses the move_uploaded_file() function.
I realize that there are many pitfalls related to filesize and uploading-
I'm testing using very small files (1-4k). I also made sure that file
uploads was enabled in the php.ini file.

Any ideas?

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




RE: [PHP] file upload question

2003-01-24 Thread Andrew Rench
thanks for the advice- this makes sense as to why I'm not seeing the file. I added the
move_uploaded_file() to the script to see what happens and I end up getting the 
following error:
PHP Warning: Unable to move '/var/tmp/phpfcwVyC' to 
'/usr/local/etc/httpd/htdocs/blast/images' in
/usr/local/etc/httpd/htdocs/blast/upload_test2.php on line 10

Am I setting the path wrong? Should it be relative to the 'upload_test2.php' file?

thanks

--- "Ford, Mike   [LSS]" <[EMAIL PROTECTED]> wrote:
> > -Original Message-
> > From: Andrew Rench [mailto:[EMAIL PROTECTED]]
> > Sent: 24 January 2003 17:05
> > 
> > the following code:
> > 
> > 
> > 
> >  > ="post">
> > 
> > Send this file: 
> > 
> > 
> >  > echo $_FILES['userfile']['tmp_name'];
> > ?>
> > 
> > 
> > 
> > produces the following after upload:
> > 
> > /var/tmp/phplSTEVp (or php[something-or-other])
> > 
> > When I view that directory, it is empty.
> 
> When you upload a file, the file PHP puts it in is a temporary file -- hence the 
>['tmp_name']
> key -- which is your /var/tmp/php??.  Because it's a temporary file, PHP 
>automatically
> deletes it when the script ends.  If you haven't done something with it in the 
>script (such as
> move_uploaded_file() it), it's gone forever.
> 
> Cheers!
> 
> Mike
> 
> -
> Mike Ford,  Electronic Information Services Adviser,
> Learning Support Services, Learning & Information Services,
> JG125, James Graham Building, Leeds Metropolitan University,
> Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
> Email: [EMAIL PROTECTED]
> Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




RE: [PHP] file upload question

2003-01-24 Thread Andrew Rench
When you say you need to include a filename, do you mean the 
$_FILES['userfile']['tmp_name'] or
the variable name identified in the input tag? (name="userfile")

--- Mark Heintz PHP Mailing Lists <[EMAIL PROTECTED]> wrote:
> 
> You have to include a filename along with the path when you're using
> move_uploaded_file(); if you're only specifying
> '/usr/local/etc/httpd/htdocs/blast/images' as your destination string, php
> is trying to create a file named 'images' in
> '/usr/local/etc/httpd/htdocs/blast'.  If there's still a problem,
> the user that your webserver (and therefore php, in most cases) runs as
> may not have write permission to the directory you're trying to move to.
> Make sure the webserver can write to the destination directory.
> 
> mh.
> 
> 
> On Fri, 24 Jan 2003, Andrew Rench wrote:
> 
> > thanks for the advice- this makes sense as to why I'm not seeing the file. I added 
>the
> > move_uploaded_file() to the script to see what happens and I end up getting the 
>following
> error:
> > PHP Warning: Unable to move '/var/tmp/phpfcwVyC' to 
>'/usr/local/etc/httpd/htdocs/blast/images'
> in
> > /usr/local/etc/httpd/htdocs/blast/upload_test2.php on line 10
> >
> > Am I setting the path wrong? Should it be relative to the 'upload_test2.php' file?
> >
> > thanks
> >
> > --- "Ford, Mike   [LSS]" <[EMAIL PROTECTED]> wrote:
> > > > -Original Message-
> > > > From: Andrew Rench [mailto:[EMAIL PROTECTED]]
> > > > Sent: 24 January 2003 17:05
> > > >
> > > > the following code:
> > > >
> > > > 
> > > > 
> > > >  > > > ="post">
> > > > 
> > > > Send this file: 
> > > > 
> > > > 
> > > >  > > > echo $_FILES['userfile']['tmp_name'];
> > > > ?>
> > > > 
> > > > 
> > > >
> > > > produces the following after upload:
> > > >
> > > > /var/tmp/phplSTEVp (or php[something-or-other])
> > > >
> > > > When I view that directory, it is empty.
> > >
> > > When you upload a file, the file PHP puts it in is a temporary file -- hence the
> ['tmp_name']
> > > key -- which is your /var/tmp/php??.  Because it's a temporary file, PHP 
>automatically
> > > deletes it when the script ends.  If you haven't done something with it in the 
>script (such
> as
> > > move_uploaded_file() it), it's gone forever.
> > >
> > > Cheers!
> > >
> > > Mike
> > >
> > > -
> > > Mike Ford,  Electronic Information Services Adviser,
> > > Learning Support Services, Learning & Information Services,
> > > JG125, James Graham Building, Leeds Metropolitan University,
> > > Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
> > > Email: [EMAIL PROTECTED]
> > > Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211
> >
> >
> > __
> > Do you Yahoo!?
> > Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> > http://mailplus.yahoo.com
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> 


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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