Skip to content

Conversation

@siddharthadevops
Copy link
Contributor

This PR improves the getFileName function to properly handle situations where multiple files with the same name are shared. The enhancement ensures unique filenames by appending a counter to duplicate names.

Changes made:

  • Modified the getFileName function to use a fileNameCounter dictionary to track filename occurrences
  • Implemented logic to append a counter to filenames when duplicates are detected

Key improvements:

  • Prevents overwriting of files with the same name
  • Maintains the original file extension
  • Generates unique filenames by appending a counter (e.g., "file_1.jpg", "file_2.jpg")

Testing:

  • Verified the function generates unique names for files with identical names
  • Tested with various file types and naming scenarios

This change resolves issues related to handling multiple shared files with the same filename, ensuring each shared file is saved with a unique name.

This PR improves the `getFileName` function to properly handle situations where multiple files with the same name are shared. The enhancement ensures unique filenames by appending a counter to duplicate names.

Changes made:
- Modified the `getFileName` function to use a `fileNameCounter` dictionary to track filename occurrences
- Implemented logic to append a counter to filenames when duplicates are detected

Key improvements:
- Prevents overwriting of files with the same name
- Maintains the original file extension
- Generates unique filenames by appending a counter (e.g., "file_1.jpg", "file_2.jpg")

Testing:
- Verified the function generates unique names for files with identical names
- Tested with various file types and naming scenarios

This change resolves issues related to handling multiple shared files with the same filename, ensuring each shared file is saved with a unique name.
@siddharthadevops siddharthadevops changed the title Enhance getFileName function to handle duplicate filenames Fix getFileName function to handle duplicate filenames Sep 11, 2024
- Modify handleIntent function to allow sharing both URL and files in the same intent
- Update text extraction logic to handle both ACTION_SEND and ACTION_VIEW intents
- Ensure attachments and text content are properly processed together
- Improve overall flexibility of shared content handling
… migrate to the non-deprecated UIApplication.open(:options:completionHandler:). Force returning false (NO).
@arrrrny
Copy link

arrrrny commented Sep 21, 2024

I created a new package zikzak_share_handler In case this package is no longer maintained, That can be used. The key issue that package not working on IOS 18 is fixed thanks to @dprpci PR If you open a PR here I can merge @siddharthadevops

@JoshJuncker JoshJuncker merged commit d5f6e7f into ShoutSocial:main Sep 24, 2024
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

Successfully merging this pull request may close these issues.

3 participants