-
Notifications
You must be signed in to change notification settings - Fork 191
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
Added uniqid() filename option #63
Conversation
Thanks, could you check code coverage and continuous integration before I can merge it ? |
Surely I will, probably in the weekend. |
The weekend was very long :) |
I'm sorry, I moved to another country in the meantime and I forgot about the PR. I doubt I will have the room to focus on this any time soon. |
Is this week on Pluto? |
Someone to continue ? :) |
This change feels awkward to me for a couple of reasons:
However, because email attachments can have filename collisions, this is a needed feature in some form. It also exposes a bug in the current I would suggest implementing it as follows:
@eXorus what do you think? |
Sorry I didn't saw your contribution @gmta I think it's a very good proposition I will prefer to have the option 2 by default. And I agree with all your remarks. Thanks, could you do this PR ? |
It's dropping the extension of the attachment. How to make sure to generate a file with relevant exptension in the case of duplicity. |
Hi @amrkamboj1988, you should probably raise a new issue for that. The proposed solution here does indeed drop the filename extension, but you could create a PR since adding the extension back is relatively simple. However, please also consider not using file extensions but rather |
In a project of mine I needed to save attachments using a unique filename.
Now you can choose between the original filename or a unique one by simply setting $use_uniqueFilename = true when calling saveAttachments($attach_dir, $use_uniqueFilename = false).
Unique filename is generated using uniqid().