Using move_uploaded_file
Posted: Tue Mar 06, 2007 7:03 am
Hi,
One of the problems with PHP is knowing when functions require an absolute path and when they don't.
move_uploaded_file appears to want an absolute path.
I'm doing:
I want to turn $destpath from a path relative to my web root in URL form (/htdocs/...) to an absolute path (e.g. C:\Apache\Apache2\htdocs\...), because this is the form move_uploaded_file seems to want. realpath() doesn't seem to be the right choice as it still seems to deal with paths relative to web root.
The ASP equivalent to what I want to do would be server.mappath (which realpath() is not, despite claims in the PHP manual).
Any ideas?
Many thanks
One of the problems with PHP is knowing when functions require an absolute path and when they don't.
move_uploaded_file appears to want an absolute path.
I'm doing:
Code: Select all
move_uploaded_file( $_FILES['file']['tmp_name'], $destpath );The ASP equivalent to what I want to do would be server.mappath (which realpath() is not, despite claims in the PHP manual).
Any ideas?
Many thanks