Here is the code i'm running for my file upload and it
work correctly:
// file with submit form
<form name="postfile" method="post"
action="./postfile.php" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE"
value="10000000">
<input type="file" name="name of var" size="x">
<input type="submit" name="submit" value="submit">
</form>

// This is the file that you want to use as post
// example is postfile.php

<?php
copy($name of var_name, "/full/path/$name of var");
?>

// That will copy the file.

here is the full function I have implemented with my
page to store path into mysql.

function
upload_prog($file,$filename,$des,$name,$size,$dateadded,$addedby,$type)
{
                copy($file, "c:/full/path/to/dir/$filename");
                $result = mysql_query("INSERT INTO
tablename(prog_name,prog_size,prog_des,prog_url,prog_date_added,added_by,prog_type)
VALUES
('$name','$size','$des','./filez/$filename','$dateadded','$addedby','$type')");
                $id = mysql_insert_id();
                $result = mysql_query("SELECT * FROM tablename WHERE
id='$id'");
                $myrow = mysql_fetch_array($result);
        }

// this will store the path into the MySQL and you can
use it as a link.

Hope this helps you.

James

__________________________________________________
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to