apachecn / apachecn/CDNDrive

[Enhanced] 关于添加文件夹上传解决方案

Open
#28 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
808
Forks
105
PR merge metrics
No merged PRs in 30d

Description

## 使用场景

当用户有多个文件需要上传时,如果一个一个上传,是一个十分费力不讨好的事情。

## 解决方案

- 方案一

**采用对文件夹进行递归搜索,自动上传**

```sh
.
├── 3006101
│   ├── 【肯尼亞-NR】炸鸡:女大学生最爱的安娜-092526-752.flv
│   └── 【肯尼亞-NR】炸鸡:女大学生最爱的安娜-092706-288.flv
├── 5655865
│   └── 【木之本切】我是猪-023439-113.flv
├── config.backup.json
└── config.json
```
对于所选定的文件夹进行全部深程递归,依次自动上传,并将每个文件对目标文件夹的相对路径做记录,与上传的分享链接组成`key - value`

在将整个字典进行base64的编码(过长的话可以考虑压缩)分享,类似于vemss/vless的分享链接

- 方案二

对目标文件夹进行tar gz 类型的压缩,然后整体上传,这样的缺点很明显,太占用系统的存储空间了。优点则是简单易懂,多平台兼容

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the repository's existing upload and sharing-link entry points, then compare how recursive folder traversal and archive uploads would fit the described solutions. Done means selecting and implementing a folder-upload approach that preserves relative paths and produces a shareable mapping for all uploaded files.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cloud
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.