I would think you could do something like
if (myFileRef.name.length > 0)
Tried myFileRef.name==null and myFileRef.name=="" and it threw an error.
1 person found this helpful
When Filereference will select file ... Select event is fired so you can check in select event whether file is selected or not. You can just assign value to variable in select event which will indicate whether file is selected or not...
I know, what I'm doing now is have a boolean variable that is false by default and gets set to true on select.
But I was hoping there was a more direct way of doing this.
FileReference has a select event that gets fired when the user selects a file.
Another way is to try to check the FileReference.size in a try..catch. An error will be thrown if the file has a size of 0 bytes.