I am using jQuery Uploadify to upload files to my site. How can I tell if a user has selected a file or not? I tried using the folder object value of the Uploa开发者_如何转开发dify object but its not working for me--it's always the same. I assume that it was null before it was selected.
How can I tell that a user has selected a file?
You could try something like this:
<script type="text/javascript">  
var selected = false;
$(document).ready(function() {
    $('#fileInput').uploadify({
        'uploader'  : 'uploadify.swf',
        'script'    : 'uploadify.php',
        'cancelImg' : 'cancel.png',  
        'auto'      : true,  
        'folder'    : '/uploads',
        'onSelect'  : function() { selected = true; },
        'onCancel'  : function() { selected = false; }
    });
});
</script>
Then you can test if 'selected' is true/false.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论