tags:

views:

90

answers:

3

How do you set the value of an input file using jquery?

$('input[type="file"]').val(value) just doesn't seem to work.

Any thoughts?

A: 

Your syntax is correct, however you can't set a value of a file input - this would be a huge security issue.

Marek Karbarz
A: 

You cannot set the value of an input-file. It's read-only.

Jonathan Sampson
+1  A: 

jquery uses javascript. You can't set/change the file path in a file input using javascript.

Ralph Stevens