Jump to content

[SOLVED] One button to upload a file


bigdawggi

Recommended Posts

Hi everyone, I have done some googling on this, but haven't found anything useful.

 

What I'm trying to accomplish is this:

1) User clicks custom button

2) That button pops up a file browser window, from which the user can choose which file to upload

3) When they select the file, it uploads that automatically.

 

I've thought of dynamically appending a form, with an input type="file", but I can't seem to find how to automatically have that 'browse' button activate (and bring up the file system browser automatically that way).  After selection, I know I can bind to the 'onChange' event, and submit the form.

 

The whole idea is to have one button that does all the action for us, and the user never sees the form; they just get a filesystem popup where they can select the file and then it will automatically upload via ajax (so they can preview it).

 

Thoughts/help are greatly appreciated!

Link to comment
https://forums.phpfreaks.com/topic/154871-solved-one-button-to-upload-a-file/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.