Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Callbacks more properties of the file #1204

Open
B-MNSN opened this issue Aug 31, 2023 · 1 comment
Open

Callbacks more properties of the file #1204

B-MNSN opened this issue Aug 31, 2023 · 1 comment

Comments

@B-MNSN
Copy link

B-MNSN commented Aug 31, 2023

I need the size of the file when confirm in filemaneger.

this my current callback

window.setURL = function(items) {
     items.icon
     items.is_file
     items.is_image
     items.name
     items.thumburl 
     items.time
     item.URL 
}

How get the size of file

@streamtw
Copy link
Member

You can achieve this by modifying config/lfm.php.

Change from:

'item_columns' => ['name', 'url', 'time', 'icon', 'is_file', 'is_image', 'thumb_url'],

to below:

'item_columns' => ['name', 'url', 'time', 'icon', 'is_file', 'is_image', 'thumb_url', 'size'],

Then in you code block, you can iterate through items and get file size like:

window.setURL = function(items) {
    items.forEach((item) => {
        console.log(item.size)
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants