0

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 Uploadify 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?

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Hi... Thanks a lot... I have one more problem regarding this. stackoverflow.com/questions/3298676/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.