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 plotBAPC画图出错
  • ¥30 关于#opencv#的问题:使用大疆无人机拍摄水稻田间图像,拼接成tif图片,用什么方法可以识别并框选出水稻作物行
  • ¥15 Python卡尔曼滤波融合
  • ¥20 iOS绕地区网络检测
  • ¥15 python验证码滑块图像识别
  • ¥15 根据背景及设计要求撰写设计报告
  • ¥20 能提供一下思路或者代码吗
  • ¥15 用twincat控制!
  • ¥15 请问一下这个运行结果是怎么来的
  • ¥15 单通道放大电路的工作原理