如何将文件上传到公共html文件夹到服务器并保存到mysql数据库的路径?

I want to upload my file into public html folder using php code at the time of uploading i want to insert the file path,size,mime type like this. Please any one give me proper solution because totally I wasted nearly one day for this

Thanks in Advance

If your upload field is named file, you can get all the informations from the $_FILES array:

Array
(
    [file] => Array
        (
            [name] => MyFile.txt 
            [type] => text/plain 
            [tmp_name] => /tmp/php/php1h4j1o
            [error] => UPLOAD_ERR_OK
            [size] => 123
        )
)

For the path, you set it yourself with move_uploaded_file:

$path = '/files/MyFile.txt';
move_uploaded_file($_FILE['file']['tmp_name'], $path);

Destination dir must be writable and you should check the return value of move_uploaded_files.