Skip to content
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

Generate name for downloaded file based on url and mime type (#726) #754

Closed
wants to merge 0 commits into from

Conversation

Alienjob
Copy link
Contributor

Resolves #726

Synopsis

Когда в профиле загружена аватарка, при её скачивании из галереи скачивается файл без расширения. При проверке обнаружилось, что при скачивании в name передаётся checksum, и файл имеет имя checksum без расширения.

Solution

Добавить метод generateFileName(url, checksum) в PlatformUtilsImpl
При сохранении в галерею когда расширение файла не задано - генерировать новое имя
Явно генерировать имя файла при сохранении аватара
При генерации для имени файла использовать его контрольную сумму или, если она не задана, текущее время
Для определения расширения файла проверить задано ли оно в url, если не задано - определить mime тип файла и назначить верное расширение

Checklist

  • Created PR:
    • In draft mode
    • Name contains issue reference
    • Has type and k:: labels applied
  • Before review:
    • Documentation is updated (if required)
    • Tests are updated (if required)
    • Changes conform code style
    • CHANGELOG entry is added (if required)
    • FCM (final commit message) is posted or updated
    • Draft mode is removed
  • Review is completed and changes are approved
    • FCM (final commit message) is approved
  • Before merge:
    • Milestone is set
    • PR's name and description are correct and up-to-date
    • All temporary labels are removed

@Alienjob Alienjob added bug Bugs and incorrectness problems k::UI/UX UI (user interface) and UX (user experience) changes labels Dec 19, 2023
@Alienjob Alienjob added this to the 0.1.0-alpha.12 milestone Dec 19, 2023
@Alienjob Alienjob self-assigned this Dec 19, 2023
@Alienjob Alienjob marked this pull request as draft December 19, 2023 10:53
@Alienjob Alienjob changed the title Draft: Generate name for downloaded file based on url and mime type (#726) Generate name for downloaded file based on url and mime type (#726) Dec 19, 2023
@Alienjob Alienjob closed this Dec 19, 2023
@Alienjob Alienjob force-pushed the 726-fix-extension-on-downloaded-avatar-image branch from 3a35251 to 66bdeb7 Compare December 19, 2023 10:59
@Alienjob Alienjob added wontfix This will not be worked on moved Issue/PR is moved to another project duplicate This issue or pull request already exists and removed moved Issue/PR is moved to another project labels Dec 19, 2023
@Alienjob
Copy link
Contributor Author

closed as double of #756

@Alienjob Alienjob deleted the 726-fix-extension-on-downloaded-avatar-image branch December 19, 2023 12:21
@SleepySquash SleepySquash added enhancement Improvement of existing features or bugfix and removed bug Bugs and incorrectness problems labels Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists enhancement Improvement of existing features or bugfix k::UI/UX UI (user interface) and UX (user experience) changes wontfix This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Avatar from MyProfile is being downloaded without an extension (.jpg, etc)
2 participants