How to get the just the filename of the uploaded file
-
I have a loop of file uploads and I want to get just the filename of file uploaded not the whole url where the filename is uploaded.
For example I uploaded a document file, I want to link to the file and the title of the link is the name of the file.
I have this code and this outputs the whole url, not the name of the file.
<?php if ( CFS()->get('files') ): echo "<ul class='small-block-grid-1'>"; $cfsloop = CFS()->get('files'); foreach ( $cfsloop as $row ) { echo '<li><a href="'; echo $row['upload']; // a sub-field named "gallery_title" echo '" class="button">'; echo $row['upload'].'</a></li>'; } echo "</ul>"; endif; ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘How to get the just the filename of the uploaded file’ is closed to new replies.