File field improvements

9 года 1 мес. назад - 9 года 1 мес. назад #698 от Gosling Cools
Gosling Cools создал тему: File field improvements
Make file extension lower case (for all those .JPG files!)

Add the second line to your table/your-item.php
$filename[0] = preg_replace("/[^A-Za-z0-9]/i", "-", $filename[0]);
$filename[1] = strtolower($filename[1]);

A current file might exist, if so delete it. Else you will end up with lots of files that don't get deleted.
After this line:
if(!JFile::exists($uploadPath)){
insert:
if($array['id'] != 0)
{ 
   // do a db query on this current item to get the current filename
   // delete this file from the server
}   
Hope this is of any use :-)
Последнее редактирование: 9 года 1 мес. назад пользователем Gosling Cools.
Спасибо сказали: Andres Maeso, Juanjo vazquez real, RIP Graphics

Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.

7 года 8 мес. назад #1401 от logic
logic ответил в теме File field improvements
i am facing following error when i try to save file filed

Error
Save failed with the following error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select FROM #__pdfperfectuploader_ WHERE id = 0' at line 1 SQL=SELECT select FROM #__pdfperfectuploader_ WHERE id = 0

Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.

Время создания страницы: 2.106 секунд
Работает на Kunena форум

We use cookies so that you can place orders and we can provide a better service. You can control the use of cookies at the individual browser level. If you reject cookies, you may still use our website, but your ability to use some features or areas of our website may be limited.