Q:

How to make a file-field automatically show the file-chooser just before the form is submitted?

I am developing one web application using CakePHP , I will be providing one button to user as "Upload ". Once user clicks on this button, I wanted to display dialogue box(browse file) so that user can choose file which would be located on his/her local machine.
Once successful uploading file I wanted to post file's data in one <textarea> which will be used for further data processing.
Below is cakephp code which I used  earlier:
echo $form->create('MyFile', array('action' => 'getTranslation', 'type' => 'file'));
echo $form->file('File');
echo $form->submit('Upload');
echo $form->end();

Here, I was getting two button's 'Upload' and 'Browse'. I don’t want to use two buttons over here. I want to use only one button i.e. 'Upload' which achieves selecting file as well as posting to some action.
Please provide me your suggestions.
Thanks
-Pravin

A:

I guess You could do that with some jQuery, add an listener to the file field, and once it's filled, post the form.
I also found this: Uploadify. If you look at the second demo, you'll see something that fits your needs. Check it out.

