时间:2021-07-01 10:21:17 帮助过:3人阅读
uploads/
/uploads/
./uploads/
../uploads/
文件上传的路径是相对于服务器的根目录还是相对于文件上传scirpt而言的。
另外上传路径有时候
uploads/
/uploads/
./uploads/
../uploads/
假设script所在路径:/data/www/project/script
目录结构:
/
data/
www/
uploads/ ①
project/
uploads/ ②
script
uploads/ ③
那么:
uploads/ 是②
/uploads/ 是③
./uploads/ 是②
../uploads/ 是①
uploads/ ==》当前路径平级的uploads目录
/uploads/==》当前路径根目录下的uploads目录
./uploads/==》当前路径前1级目录下的uploads目录
../uploads/==》当前路径前2级目录下的uploads目录
楼上正确,我习惯是尽量用/打头写相对根路径
我觉得你打印输出一下就会得到答案。。。