有没有一种方法可以默认设置或在不使用zip文件的情况下建议直接下载的文件夹结构?

时间:2018-07-12 22:09:00

标签: javascript angularjs typescript download jszip

问:是否可以在不使用zip文件的情况下直接默认下载或建议文件夹结构?

我有一个AngularJS应用程序,可用于生成导入到商用计算机中的文本文件。为了使导入正常进行,必须将文件嵌入特定的文件夹结构中。有没有一种方法可以通过下载对话框建议此文件夹结构,而不必使用zip文件?

我们今天使用的是zip,但Windows用户在计算机上运行的摘录中遇到了问题(请参阅this question)。好奇是否有办法完全绕开拉链。

相关信息:

  • 角度版本:5.2.10
  • Zip Utility中的角度:JSZip 3.1.5

JSZip代码:

[OKAY] Loaded ENV .env File as KEY=VALUE Format
11:41:09 PM web.1 |  [2018-07-12 23:41:09 +0200] [67332] [INFO] Starting 
gunicorn 19.9.0
11:41:09 PM web.1 |  [2018-07-12 23:41:09 +0200] [67332] [INFO] 
Listening at: http://0.0.0.0:5000 (67332)
11:41:09 PM web.1 |  [2018-07-12 23:41:09 +0200] [67332] [INFO] Using 
worker: sync
11:41:09 PM web.1 |  [2018-07-12 23:41:09 +0200] [67335] [INFO] Booting 
worker with pid: 67335
11:41:09 PM web.1 |  [2018-07-12 23:41:09 +0200] [67335] [ERROR] 
Exception in worker process
11:41:09 PM web.1 |  Traceback (most recent call last):
11:41:09 PM web.1 |    File "/Library/Python/2.7/site- 
packages/gunicorn/arbiter.py", line 583, in spawn_worker
11:41:09 PM web.1 |      worker.init_process()
11:41:09 PM web.1 |    File "/Library/Python/2.7/site-                
packages/gunicorn/workers/base.py", line 129, in init_process
11:41:09 PM web.1 |      self.load_wsgi()
11:41:09 PM web.1 |    File "/Library/Python/2.7/site- 
packages/gunicorn/workers/base.py", line 138, in load_wsgi
11:41:09 PM web.1 |      self.wsgi = self.app.wsgi()
11:41:09 PM web.1 |    File "/Library/Python/2.7/site- 
packages/gunicorn/app/base.py", line 67, in wsgi
11:41:09 PM web.1 |      self.callable = self.load()
11:41:09 PM web.1 |    File "/Library/Python/2.7/site- 
packages/gunicorn/app/wsgiapp.py", line 52, in load
11:41:09 PM web.1 |      return self.load_wsgiapp()
11:41:09 PM web.1 |    File "/Library/Python/2.7/site- 
packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
11:41:09 PM web.1 |      return util.import_app(self.app_uri)
11:41:09 PM web.1 |    File "/Library/Python/2.7/site- 
packages/gunicorn/util.py", line 350, in import_app
11:41:09 PM web.1 |      __import__(module)
11:41:09 PM web.1 |    File "/Users/x/Dev/projects/my-app/app.py", 
line 9, in <module>
11:41:09 PM web.1 |      from platforms.hitta import Hitta
11:41:09 PM web.1 |  ImportError: No module named platforms.hitta
11:41:09 PM web.1 |  [2018-07-12 23:41:09 +0200] [67335] [INFO] Worker 
exiting (pid: 67335)
11:41:09 PM web.1 |  [2018-07-12 23:41:09 +0200] [67332] [INFO] Shutting 
down: Master
11:41:09 PM web.1 |  [2018-07-12 23:41:09 +0200] [67332] [INFO] Reason: 
Worker failed to boot.
11:41:09 PM web.1 Exited with exit code 3

1 个答案:

答案 0 :(得分:1)

您可以使用tar而不是zip。

https://github.com/beatgammit/tar-js

但是,不可以,除非您将目录以某种方式转换为单个文件,否则您将无法下载。