ildarvasin Posted July 6, 2020 Share Posted July 6, 2020 I did upload files to the server and now I need to display the names of these files on my page.how to do it. thank you in advance. Link to comment Share on other sites More sharing options...
louisstephens Posted July 6, 2020 Share Posted July 6, 2020 In your template, you should be able to do echo $page->your_file_field->name; This is a good cheatsheet regarding the file field as well: https://cheatsheet.processwire.com/files/file-properties/ I apologize, I kinda missed that you were not going through a file field but were uploading to a directory. This might be a bit better approach for you then: 1 Link to comment Share on other sites More sharing options...
kongondo Posted July 6, 2020 Share Posted July 6, 2020 Alternatively, you could use ProcessWire's API $files https://processwire.com/api/ref/wire-file-tools/ To find files in a folder, you can use $files->find(); https://processwire.com/api/ref/wire-file-tools/find/ Link to comment Share on other sites More sharing options...
ildarvasin Posted July 7, 2020 Author Share Posted July 7, 2020 21 hours ago, louisstephens said: In your template, you should be able to do echo $page->your_file_field->name; This is a good cheatsheet regarding the file field as well: https://cheatsheet.processwire.com/files/file-properties/ I apologize, I kinda missed that you were not going through a file field but were uploading to a directory. This might be a bit better approach for you then: thank you so much.you really helped Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now