Example: {code...} example:
Use demo.txt to obtain the full path: C:/Users/ilovemosh/Desktop/demo.txt.
Reply content:
For example:
Use demo.txt to obtain the full path: C:/Users/ilovemosh/Desktop/demo.txt.
Your file must be in include_path. it is impossible for you to give an absolute path to a file name .. Not so powerful
Portal
Dirname (_ FILE __)
Obtain the absolute path of a file
Folder where the PHP file is currently executed_ DIR __
AccordingDemo.txt
The relativity with the current PHP file is just to determine the file path.
Generally, you must first use a certain method (such as uploading) to obtain the file information.
In js, the plupload plug-in obtains the information of this file by uploading this file (but it is not necessarily where the file is successfully uploaded, but by obtaining the file object for calculation, all file path information can be obtained for php yii Framework uploads.