ildarvasin Posted July 6, 2020 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.
louisstephens Posted July 6, 2020 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
kongondo Posted July 6, 2020 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/
ildarvasin Posted July 7, 2020 Author 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
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