mirror of
https://github.com/rclone/rclone.git
synced 2024-11-29 12:04:11 +08:00
fichier: fix character encoding for file names, fixes rclone#3298
This commit is contained in:
parent
8247c8a6af
commit
9aa889bfa2
|
@ -166,6 +166,7 @@ func (f *Fs) listDir(ctx context.Context, dir string) (entries fs.DirEntries, er
|
||||||
entries = make([]fs.DirEntry, len(files.Items)+len(folders.SubFolders))
|
entries = make([]fs.DirEntry, len(files.Items)+len(folders.SubFolders))
|
||||||
|
|
||||||
for i, item := range files.Items {
|
for i, item := range files.Items {
|
||||||
|
item.Filename = restoreReservedChars(item.Filename)
|
||||||
entries[i] = f.newObjectFromFile(ctx, dir, item)
|
entries[i] = f.newObjectFromFile(ctx, dir, item)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -315,6 +316,8 @@ func (f *Fs) getUploadNode() (response *GetUploadNodeResponse, err error) {
|
||||||
func (f *Fs) uploadFile(in io.Reader, size int64, fileName, folderID, uploadID, node string) (response *http.Response, err error) {
|
func (f *Fs) uploadFile(in io.Reader, size int64, fileName, folderID, uploadID, node string) (response *http.Response, err error) {
|
||||||
// fs.Debugf(f, "Uploading File `%s`", fileName)
|
// fs.Debugf(f, "Uploading File `%s`", fileName)
|
||||||
|
|
||||||
|
fileName = replaceReservedChars(fileName)
|
||||||
|
|
||||||
if len(uploadID) > 10 || !isAlphaNumeric(uploadID) {
|
if len(uploadID) > 10 || !isAlphaNumeric(uploadID) {
|
||||||
return nil, errors.New("Invalid UploadID")
|
return nil, errors.New("Invalid UploadID")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user