Repository: AlistGo/alist (language: go)

Issue:
把文件从本地复制到网盘，会先在temp目录下复制一份，会占满磁盘无法上传
### Please make sure of the following things

- [X] I have read the [documentation](https://alist.nn.ci).
- [ ] I'm sure there are no duplicate issues or discussions.
- [X] I'm sure it's due to `alist` and not something else(such as `Dependencies` or `Operational`).
- [X] I'm sure I'm using the latest version

### Alist Version / Alist 版本

v3.3.0

### Driver used / 使用的存储驱动

Onedrive 本地存储

### Describe the bug / 问题描述

Alist添加 从本地向Onedrive复制 的任务，会先在 alist安装目录/data/temp下创建一个一样的副本，而不是直接上传。当需要复制的文件过大直接把服务器磁盘都占满了。
![image](https://user-images.githubusercontent.com/36957938/199504036-c0d3e95c-a4b1-4c4d-b9d3-314cd95ee58b.png)


### Reproduction / 复现链接

无

### Logs / 日志

```shell
root@ip-172-26-22-250:/opt/alist/log# tail -f log.log 
[GIN] 2022/11/02 - 13:36:08 | 200 |     111.931µs |     42.3.27.163 | GET      "/api/admin/task/copy/undone"
[GIN] 2022/11/02 - 13:36:10 | 200 |     139.509µs |     42.3.27.163 | GET      "/api/admin/task/copy/undone"
[GIN] 2022/11/02 - 13:36:12 | 200 |     142.233µs |     42.3.27.163 | GET      "/api/admin/task/copy/undone"
[GIN] 2022/11/02 - 13:36:25 | 200 |   24.897416ms |     42.3.27.163 | GET      "/api/admin/task/copy/undone"
ERRO[2022-11-02 13:36:45] error [write /opt/alist/data/temp/47a26196-0662-4d9e-912e-f4902bc4f542-ANSYS_Products_2021_R2x64.zip: copy_file_range: no space left on device
failed get [/home/ubuntu/alist/ANSYS_Products_2021_R2x64.zip] stream] while run task [copy [/本地](/home/ubuntu/alist/ANSYS_Products_2021_R2x64.zip) to [/Onedrive](/设计)] 
[GIN] 2022/11/02 - 13:37:26 | 200 |   16.018306ms |     42.3.27.163 | GET      "/api/admin/task/copy/undone"
[GIN] 2022/11/02 - 13:38:25 | 200 |     115.406µs |     42.3.27.163 | GET      "/api/admin/task/copy/undone"
[GIN] 2022/11/02 - 13:39:26 | 200 |     127.374µs |     42.3.27.163 | GET      "/api/admin/task/copy/undone"
[GIN] 2022/11/02 - 13:40:25 | 200 |     123.392µs |     42.3.27.163 | GET      "/api/admin/task/copy/undone"
[GIN] 2022/11/02 - 13:41:25 | 200 |      154.18µs |     42.3.27.163 | GET      "/api/admin/task/copy/undone"
```



Discussion / hints:
Thanks for opening your first issue here! Be sure to follow the issue template!

一样的疑问，他会自动在temp先下载 在转移到挂载的本地或远程网盘。如果本地存储不足，怎么下载。希望加个设置 指定临时下载点（当然一般是本地挂载的硬盘） 而默认的temp在alist挂载的opt路径里
俺也很疑惑，为啥本地上传，也要重新拷贝一份。HDD的小鸡实在受不了，本地拷贝比上传速度还慢！
> 一样的疑问，他会自动在temp先下载 在转移到挂载的本地或远程网盘。如果本地存储不足，怎么下载。希望加个设置 指定临时下载点（当然一般是本地挂载的硬盘） 而默认的temp在alist挂载的opt路径里

https://alist.nn.ci/zh/config/configuration.html#%E5%88%9D%E5%A7%8B%E9%85%8D%E7%BD%AE
> 

谢谢 发现了 在config.json里可以修改temp路径了
Hello, this issue has been inactive for more than 30 days and will be closed if inactive for another 30 days.
同时建议 temp 目录下的文件，在使用后自动删除，既然是临时过渡文件，产生了又不删除，时间长了容易积累大量文件。
Hello @, this issue was closed due to inactive more than 60 days. You can reopen or recreate it if you think it should continue.

Fix patch:
diff --git a/internal/fs/util.go b/internal/fs/util.go
index b5d0cb4b64c..795a18883a0 100644
--- a/internal/fs/util.go
+++ b/internal/fs/util.go
@@ -41,9 +41,9 @@ func getFileStreamFromLink(file model.Obj, link *model.Link) (*model.FileStream,
 	if link.Data != nil {
 		rc = link.Data
 	} else if link.FilePath != nil {
-		// copy a new temp, because will be deleted after upload
+		// create a new temp symbolic link, because it will be deleted after upload
 		newFilePath := stdpath.Join(conf.Conf.TempDir, fmt.Sprintf("%s-%s", uuid.NewString(), file.GetName()))
-		err := utils.CopyFile(*link.FilePath, newFilePath)
+		err := os.Symlink(*link.FilePath, newFilePath)
 		if err != nil {
 			return nil, err
 		}


Test patch: