0

<input type="file"> will open a file open dialog when clicked.
I want to open the same file open dialog, with the button only (no input text) and with Open text on the button (not Browse) - any ideas?

3
Contributors
8
Replies
10
Views
7 Years
Discussion Span
Last Post by diafol
0

What is the purpose of just using the button to browse? There doesn't seem to be any logic in it to me. The only real reason is to upload.

Maybe i'm missing something...
Sorry

0

The file field is not a button + text input field - it's one thing. Using a button to open the dialog box - why? The file field does more than just store a filename. Sorry if you knew that already.

However, have a look at this: http://valums.com/wp-content/uploads/ajax-upload/demo-prototype.htm#

This is what I want, but is there simpler a way to implement it without the prototype/ajax stuff?

0

This is what I want, but is there simpler a way to implement it without the prototype/ajax stuff?

Don't know. I don't think the prototype stuff is too complex. You're asking the thingummy to do a lot (open 'open dialog', attach file, upload file, report when successful).

0

Don't know. I don't think the prototype stuff is too complex. You're asking the thingummy to do a lot (open 'open dialog', attach file, upload file, report when successful).

Actually I don't want to upload the file to the server, I want the client code to process it.
Now I understand that native Javascript can not read/write files from the user's computer. Does the prototype example work with OS / platforms other than windows?

0

prototype is designed to be os independent. jquery the same. You'll need to use ajax I think to get hold of files.

I think you'll need an invisible file field anyway to open the old dialog. Add a button or clickable image or whatever to act as a pseudo file field (linked via js to file field). See the link I gave you for the source code. In fact, it seems that this script does what you want as the actual uploading has been disabled. Result!

Edited by diafol: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.