Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 下载文件时没有文件路径问题_Html_Reactjs - Fatal编程技术网

Html 下载文件时没有文件路径问题

Html 下载文件时没有文件路径问题,html,reactjs,Html,Reactjs,我试图做一个非常基本的下载按钮,但我总是无缘无故地没有得到任何文件,因为我的文件基本上和代码在同一个地方,上传截图以便更好地理解 <a href='test.txt' download> <AiOutlineDownload href='./test.txt' download size={25}>. </AiOutlineDownload> </a> 所以按钮可以工作,因为它正在下载,但我没有得到任何文件 这是我放置文件的路径/

我试图做一个非常基本的下载按钮,但我总是无缘无故地没有得到任何文件,因为我的文件基本上和代码在同一个地方,上传截图以便更好地理解

<a href='test.txt' download>
  <AiOutlineDownload href='./test.txt' download size={25}>. 
  </AiOutlineDownload>
</a>

所以按钮可以工作,因为它正在下载,但我没有得到任何文件

这是我放置文件的路径/位置

所以它们在同一个文件夹中。希望得到帮助。 我尝试了/test.txt、/test.txt、test.txt