PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I want all my uploaded files in another file system than the one the site is running. When I pass the absolute path as argument for move_uploaded_file function, everything is working fine. But, I want to use relative path. For that I have created a new alias called "userUploads" in apache. But, when I use this in the same function it is returning error. I know, to get the absolute path from a relative path there is a function called Server.MapPath in ASP. Is there any equivalent function in PHP. The main reason I am insisting on virtual path is the difference in file system of our test and live servers. Here is the working code.
Thank you Mac, But, The "filename" method of apache_lookup_uri() object retruns the absolute path of the current directory, irrespective of the parameter supplied. I think this is useful, only if the file is in the current directory. But, my file is not in the directory where the current file is being executed.
For the time being I have solved this by assigning a variable for my absolute path (On a generic include file) and manually changing it when uploading the files onto the production server. But, I feel difficult to believe PHP doesn't have a function to handle this. Any more suggestions..?