这就是我的情况:用户上传包含多个文件的.rar文件。
.rar文件显示并可下载。
但是,如何在前端实现一个函数来显示要下载的.rar文件的链接(整个文件),然后.rar中的所有子文件也可以显示供下载(一次一个)?
下面是前端输出的样子:
These files are available for download:
-[link]raredfile.rar (linked to download: the whole rar file)
-[link]file 1 (linked to download: file 1 in the .rar file)
-[link]file 2 (linked to download: file 2 in the .rar file)是可能的吗?如果是的话,你能给我一些指点吗?该怎么用?
谢谢你的回答。
致以问候。
发布于 2014-05-14 08:45:12
1.上传.rar
上传您的.rar文件。
存储在文件夹上:
示例:
项目/文件/rar.rar
2.提取.rar
提取您的.rar文件。
现在您应该有两个同名的文件:
project/files/rar.rar - rar文件
project/files/rar/ -文件夹
3.下载档案
现在,您可以使用后端语言显示文件夹的所有内容。
示例:
<a href="project/files/rar.rar">raredfile.rar</a> (linked to download: the whole rar file)
- <a href="project/files/rar/file1.txt">file 1</a> (linked to download: file 1 in the .rar file)
- <a href="project/files/rar/file2.txt">file 2</a> (linked to download: file 2 in the .rar file)https://stackoverflow.com/questions/23649514
复制相似问题