Is there any function in javascript-php that can obtain the full path of this file based on the file name? Or how does js obtain the full file path?

Source: Internet
Author: User
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.txtThe 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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.