Hello,
i almost solved my problem, but there is still a little fault. In one
of my views i readout a database cell, with a text inside, e.g. 13.pdf
(13.pdf = document_name).
The little fault is, when i click on the text in the column (e.g.
13.pdf) a download-windows opens and the file i download
The basename function returns the filename with the suffix! Try to
change your code to:
[code]
$basename = basename($file);
$file_extension = substr(strrchr($basename,.),1);
$basename = basename($file, '.'.$file_extension);
...
$this-set('extension', strtolower($file_extension));
John
Hello,
thanks for your answer! :)
I've added your code.
Well, I found out, that my old code (same result with your code) also
works, but only with 3 of my 4 test-data-rows.
It works for '13.pdf', '288.pdf' and '3.pdf'. It fails for
'19.pdf' (result on click = 19.pdf.pdf) and i absolutely
John
Hello,
thanks for your answer! :)
I've added your code.
Well, I found out, that my old code (same result with your code) also
works, but only with 3 of my 4 test-data-rows.
It works for '13.pdf', '288.pdf' and '3.pdf'. It fails for
'19.pdf' (result on click = 19.pdf.pdf) and i absolutely
John
Hello,
thanks for your answer! :)
I've added your code.
Well, I found out, that my old code (same result with your code) also
works, but only with 3 of my 4 test-data-rows.
It works for '13.pdf', '288.pdf' and '3.pdf'. It fails for
'19.pdf' (result on click = 19.pdf.pdf) and i absolutely
I suggest you turn on debug and add some debug statements in between
your code, so you can see what the content of each variable is at
specific places. Debug is turned on in your core.php file in the
config directory.
Use debug statements:
debug($basename);
debug($file_extension);
and maybe some