EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
September 14, 2025, 03:36:00 PM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
EasyUI Forum
>
General Category
>
EasyUI for jQuery
>
How to get the files array (not the file name) from filebox component?
Pages: [
1
]
« previous
next »
Print
Author
Topic: How to get the files array (not the file name) from filebox component? (Read 13635 times)
dacracot
Newbie
Posts: 6
How to get the files array (not the file name) from filebox component?
«
on:
July 23, 2015, 08:10:35 AM »
With the HTML,
<input id="HTML-GetFile" type="file"/>
, I can get the get the files array via
$('#HTML-GetFile').files;
for each file with its name, size, etc.
But for the EasyUI component,
<input id="EasyUI-GetFile" class="easyui-filebox"/>
there is no files property.
This call,
$('#Upload-ChooseFile').filebox('getValue');
yields only the file name. Buried in the generated code is the array I need assessable via
$('firebox_file_id_1')[0].files;
, but I had to dig through the DOM to find this and I have to believe this ID, being code generated, is brittle.
What must I do to get the files array rather than just the file name directly from my filebox component?
Logged
jarry
Administrator
Hero Member
Posts: 2298
Re: How to get the files array (not the file name) from filebox component?
«
Reply #1 on:
July 23, 2015, 08:27:41 AM »
Please try the code below to get the file input element and retrieve the files array.
Code:
var f = $('#EasyUI-GetFile').next().find('.textbox-value');
console.log(f[0].files);
Logged
dacracot
Newbie
Posts: 6
Re: How to get the files array (not the file name) from filebox component?
«
Reply #2 on:
July 23, 2015, 08:43:15 AM »
That worked, but is this compound statement any less brittle if I upgrade the libraries at some point in the future?
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> News
=> General Discussion
=> EasyUI for jQuery
=> EasyUI for Angular
=> EasyUI for Vue
=> EasyUI for React
=> Bug Report
Loading...