[Solved] Uploads module doesn't allow 2 files with same name

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
Lostwitheal
New Member
New Member
Posts: 4
Joined: Tue Sep 18, 2012 9:18 pm

[Solved] Uploads module doesn't allow 2 files with same name

Post by Lostwitheal »

I have the Uploads module installed, and it's working perfectly apart from one detail. I would like to allow all registered users to upload files and expect a fairly large number of uploads. As people tend to not be too original in naming their files, I expect that at some point I will have several people trying to upload files named "img1.png" or "untitled.png" or "a.png", etc.
At this point the Uploads module does not allow uploads of two files with the same name. Is there a way to get around this?

Thanks,
Lostwiteal
Last edited by Lostwitheal on Sun Oct 21, 2012 10:25 am, edited 1 time in total.
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1978
Joined: Mon Jan 29, 2007 4:47 pm

Re: Uploads module doesn't allow 2 files with same name

Post by Jo Morg »

Not sure if it will work as I have never attempted to do this, but you could try to handle the uploads event OnUpload with an UDT that generates an unique ID and attaches it to the file name. That would only work IF the event is pre-save which I'm not sure it is. But it may be worth a try :)
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Uploads module doesn't allow 2 files with same name

Post by Dr.CSS »

I was under the impression that Uploads makes a new folder for every upload using a unique ID for each folder...

Are you trying to upload these same named files from the front or backend..?
Lostwitheal
New Member
New Member
Posts: 4
Joined: Tue Sep 18, 2012 9:18 pm

Re: Uploads module doesn't allow 2 files with same name

Post by Lostwitheal »

Dr.CSS wrote:I was under the impression that Uploads makes a new folder for every upload using a unique ID for each folder...

Are you trying to upload these same named files from the front or backend..?
I was testing it from the front end (logged in as a regular website user)

CSS Doctor - I might try that, thanks.
Post Reply

Return to “Modules/Add-Ons”