(Rails) Uploading Directories

2019-01-25 21:14发布

I need to upload multiple files on my website.

But I need not just a form for uploading multiple files, I need to upload whole directories.

How's this possible for the minimalist?

Yours, Joern.

2条回答
放我归山
2楼-- · 2019-01-25 21:59

According to my somewhat limited knowledge this is not possible, only file transfer is possible, not directories.

Here are some workarounds, based on discussion on Velocity Reviews and another discussion:

  • upload a zip, which you unzip at the server side
  • upload directories over ftp (web page can be a front end to this)
  • upload files one by one

I would go either for zip or ftp. Note: someone might have produced a gem that enables uploading directories (I know nothing of such thing, but I will be happy to find out, if there is).

查看更多
The star\"
3楼-- · 2019-01-25 22:08

Adding another option to the list provided by Sorrow:

  • upload via REST/JSON

OK, this is a partial solution, but it does give you the opportunity to write a script that reads your directory and POSTS to your website.

查看更多
登录 后发表回答