File field improvements

9 år 7 måneder siden - 9 år 7 måneder siden #698 af Gosling Cools
File field improvements blev oprettet af Gosling Cools
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 :-)
Sidste redigering: 9 år 7 måneder siden ved Gosling Cools.
Følgende bruger(e) sagde tak: Andres Maeso, Juanjo vazquez real, RIP Graphics

Venligst Log på eller Opret en konto for at deltage i samtalen

8 år 3 måneder siden #1401 af logic
Besvaret af logic på emne 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

Venligst Log på eller Opret en konto for at deltage i samtalen

Tid til at oprette siden: 0.047 sekunder
Leveret af Kunena Forum

Vi we benytter cookies, så vi bedst muligt kan levere vores services. For mere information, se vores