Re: Help with file upload

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Bunmi Akinmboni wrote:

His is the new code:
<?php
if (is_uploaded_file($_FILES['ufile1']['tmp_name'])) {
    copy($_FILES['ufile1']['tmp_name'], ".");

You should be using move_uploaded_file() instead of copy(), first of all.


Next, the two arguments passed to either copy() or move_uploaded_file() are _filenames_, not directories. So something like

move_uploaded_file($_FILES['ufile1']['tmp_name'],'./' . $_FILES['ufile1']['name']);

is probably what you're after.

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux