Skip to content

[BUG]extensions.py extension  #169

@yulk

Description

@yulk

When the uploaded file is all in Chinese, such as "图片.png", the extension function in this file flask_uploads\extensions.py. will return empty.

Maybe you should modify like this:

def extension(filename: str) -> str:
    ext = os.path.splitext(filename)[1] if len(os.path.splitext(filename)[1]) >0 else os.path.splitext(filename)[0]
    if ext.startswith('.'):
        # os.path.splitext retains . separator
        ext = ext[1:]
    return ext

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions