mjpclab / go-http-file-server

Simple command line based HTTP file server to share local file system
MIT License
379 stars 55 forks source link

global-mkdir命令开启的问题 #21

Closed wangdemon closed 2 years ago

wangdemon commented 2 years ago

大佬,我使用--global-mkdir命令后,确实可以将包含子文件及子文件夹的的文件夹一起上传,但是子文件超过100个,也只能上传100个

marjune163 commented 2 years ago

我试下来没问题呢,是不是磁盘满了?

wangdemon commented 2 years ago

可以看下面视频,在wins系统,我有三个文件夹,每个文件夹中有114张png图片,上传到ubuntu服务后,每个文件夹中,只有100张png图片。

https://user-images.githubusercontent.com/20681339/177304185-161a21d4-91ae-4305-a4bb-8554928ae3f1.mp4

marjune163 commented 2 years ago

一般图片大小是多少呢?

marjune163 commented 2 years ago

看上去是Chrome类浏览器的限制,单个目录下的文件被限制在100个了,我试了下目前Firefox是没问题的。

wangdemon commented 2 years ago

是的,您说的对。谷歌浏览器确实有限制,火狐浏览器上传文件没有问题。

marjune163 commented 2 years ago

https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryReader/readEntries

On Chrome 77, readEntries() will only return the first 100 FileSystemEntry instances. In order to obtain all of the instances, readEntries() must be called multiple times.

wangdemon commented 2 years ago

感谢老哥无私奉献

marjune163 commented 2 years ago

下一版会修复的。

marjune163 commented 2 years ago

已在1.14.0中修复。

wangdemon commented 2 years ago

谢谢您,老哥真的很用心!

wangdemon commented 2 years ago

hfs 1.14.0版本,在str.go文件中,使用了utf8.AppendRune(buf, r),这个函数好像在golang 1.18中才有。我的go1.17版本,编译不过,升级到go的最新版,就编译过了。

marjune163 commented 2 years ago

嗯,看来要更新下Readme了,多谢。 1.9的分支用了另一个方法,可能执行会慢一点 https://github.com/mjpclab/go-http-file-server/blob/main-go1.9to1.15/src/util/str.go#L56