获取POST文件的绝对路径

I have a simple HTML form that allows a user to select a file.

What's supposed to happen next is the function called loops through most the files in the source directory(based on file type) to input a bunch of production statistics into a local DB.

The only problem is I can't get the absolute path from for example the C:My Docs. I can get the temporary path that gets assigned to the one file but not the original.

So is there anyway in the page sending the file to get the path and send the string? Or get the absolute path in the function that the HTML form calls?

Thanks, bmckie

When a file is posted to PHP, it is always initially saved in the temporary path. The PHP script that is receiving the post needs to use that temporary path and the move_uploaded_file() function to actually save it to a more permanent, desired location.

<?php
move_uploaded_file($_FILES["picture"]["tmp_name"], "/path/to/directory/filename.ext);

The move_uploaded_file function takes two parameters. The first is the current location of the file. You can inspect the $_FILES superglobal variable to find this and other things including the original filename. The second parameter is the path and filename you want to save it as on your local (server) system. You can use whatever naming convention you want. However, the original filename can also be found from the $_FILES superglobal variable.