Home > Backend Development > PHP Tutorial > 高手,上传视频文件到服务器 /upload/ 目录是没法读取的吗?

高手,上传视频文件到服务器 /upload/ 目录是没法读取的吗?

WBOY
Release: 2016-06-23 13:16:51
Original
1030 people have browsed it

只能上传到网站根目录的upload/目录 才能读取 ?


回复讨论(解决方案)

不是,相对路径也是可以的,例如

目录结构如下
upload/a.txt
test/test.php

在test.php 获取 upload/a.txt内容

<?php$file = '../upload/a.txt';$data = file_get_contents($file);echo $data;?>
Copy after login

在网站根目录建立upload再建立video,上传到/upload/video/

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template