Skip to content

[BUG]extensions.py extension #169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
yulk opened this issue Mar 28, 2024 · 1 comment
Open

[BUG]extensions.py extension #169

yulk opened this issue Mar 28, 2024 · 1 comment

Comments

@yulk
Copy link

yulk commented Mar 28, 2024

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
@jugmac00
Copy link
Owner

Thank you for the report. Would you be able to create a pull request with the fix? And ideally a test case which shows the bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants