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.
Workaround for already existing filename
-
And.kruße
- Phoca Newbie

- Posts: 2
- Joined: 10 Oct 2014, 10:57
- Jan
- Phoca Hero

- Posts: 49144
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Workaround for already existing filename
Hi, depends on where you will customize the code:
- if in frontend in category view
- if in frontend in UCP
- or in backend?
Jan
- if in frontend in category view
- if in frontend in UCP
- or in backend?
Jan
If you find Phoca extensions useful, please support the project
-
And.kruße
- Phoca Newbie

- Posts: 2
- Joined: 10 Oct 2014, 10:57
Re: Workaround for already existing filename
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.
I want to change it for category view. The user is not allowed to use UCP and backend.
Thank you for the reply.
- Jan
- Phoca Hero

- Posts: 49144
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Workaround for already existing filename
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

Jan
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
Jan
If you find Phoca extensions useful, please support the project