dongpu5874 2014-05-14 08:34
浏览 54
已采纳

正在上传.rar文件

This is my case: A user uploads a .rar file containing multiple files.

The .rar file is shown and downloadable.

But how to implement a function on the front end that would show the .rar file to be downloaded with a link (the whole file) and then all child files in the .rar could be shown for download also (one at a time)?

Here is what the output would look like on the front end:

   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)

Is is possible? If so could you give me some pointers what to use and how?

Thank you for answering.

Regards.

  • 写回答

1条回答 默认 最新

  • dongwu8653 2014-05-14 08:45
    关注

    1. Upload the .rar

    upload your .rar file.
    store on a folder:
    example:

    project/files/rar.rar

    2. Extract .rar

    extract your .rar file.
    now you should have 2 files with the same name:

    project/files/rar.rar - rar file
    project/files/rar/ - folder

    3. Downloading the files

    now you can display all the contents of the folder using a backend language.
    example:

      <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)
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 制裁名单20240508芯片厂商
  • ¥20 易康econgnition精度验证
  • ¥15 msix packaging tool打包问题
  • ¥28 微信小程序开发页面布局没问题,真机调试的时候页面布局就乱了
  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致