jQuery File Type Input Plugin needed
I am looking to customize the input type file 开发者_JAVA技巧to a custom browse button. does anyone know of any good plugins i could use of ?
That is not possible due to browser security. You have to use the input element with the type file. I think you can put and image on top of the browser button to customize it as long you make sure that the click event is past to the file input.
Because of browser security you can not access the clients file system with anything other as the file input element. You never get the file structure with a script language such as javascript. Not even when you check the value attribute with for example javascript. The value attribute will only return the filename not the path.
You could try to use Uploadify jquery plugin to customize the button. But that will work with a flash file if I remember correct.
Edit: Yes checked it. It is possible with Uploadify. There is an option buttonImg
you can use.
$(document).ready(function() {
$('#file_upload').uploadify({
'uploader' : '/uploadify/uploadify.swf',
'script' : '/uploadify/uploadify.php',
'cancelImg' : '/uploadify/cancel.png',
'folder' : '/uploads',
'buttonImg' : '/img/inputbutton.png',
'auto' : true
});
});
精彩评论