views:

28

answers:

3

i want to show file upload dialog on click of a button thats not the part of input[type="file"] how can i do this?

Basically i want to stylize the file upload control of html.

+1  A: 

I'm pretty sure there is no way to do this for security reasons.

You may be able to do it using a Flash-based uploader like SWFUpload. It obviously needs Flash installed and functions in a slightly different way than normal file uploads.

Pekka
A: 

two days ago i was dealing with the same thing. I spotted uploadify

it allows you to have custom button for upload and ability to style your progress bar. it makes an ajax call to a php script. it also has loads of options from restricting file types/sizes/etc.

pretty happy i found it. same as pekka said this one also uses a flash gateway to do this.

XGreen
+1  A: 

Alternate way to style file inputs using JavaScript but no Flash:

http://www.shauninman.com/archive/2007/09/10/styling_file_inputs_with_css_and_the_dom

Paul Groves