Page 1 of 1

Workaround for already existing filename

Posted: 10 Oct 2014, 11:19
by And.kruße
Hello together,

I need some help, to customize any file(s) which are responsible for the upload process.
When you try to upload an image which has the same filename that already exists on the server in usersfolder, you will get an error and the upload doesn't work. If I get this error during upload, I know how to handle it. But there are some other users who use the upload process and don't know how to handle it. I will try to solve this problem in the backend.
My suggestion is, to add a number at the end of the original filename. The best thing would be to add the current date and maybe time without any special caracters. "filename_currentdate.jpg"
Is it generally possible to include the current date in the filename?
Which file does handle the filename during upload? Maybe we can add some lines there?

It would be great, if anyone has an idea. I think this solution will help more people than only me.

Thanks a lot and best regards.

Re: Workaround for already existing filename

Posted: 11 Oct 2014, 16:07
by Jan
Hi, depends on where you will customize the code:

- if in frontend in category view
- if in frontend in UCP
- or in backend?

Jan

Re: Workaround for already existing filename

Posted: 12 Oct 2014, 11:23
by And.kruße
Hey Jan,

I want to change it for category view. The user is not allowed to use UCP and backend.

Thank you for the reply.

Re: Workaround for already existing filename

Posted: 14 Oct 2014, 00:22
by Jan
Hi, such files you can find in:

components/com_phocagallery/views/user/view.html.php
components/com_phocagallery/views/user/tmpl/ ...

components/com_phocagallery/controllers/user.php
components/com_phocagallery/models/user.php


:idea:

Jan