views:

112

answers:

1

Hi,

I would like to to create a 2-step file uploader:

  1. Open dialog.
  2. Select one file from computer.

I would like to eliminate the step where the user must submit the form, and instead do it automatically with JavaScript. Is there anyway to achieve it?

Thanks.

+1  A: 

Setting an onChange event and checking for whether the ".value" of the upload field is "!= null" does the trick for me. However, accessing file upload fields programmatically is always a shaky issue, and things can change with future browser security updates. If you want to be sure, use a flash based upload component like SWFUpload.

Pekka