Avatar of nlpalmquist
nlpalmquist
Flag for United States of America asked on

HTTPS POST with a file Upload

I need dynamic web page that will upload a file to a web service.  I would very much like the web page to be able to know the file name automatically and execute submit. Without the file upload, I can make a page submit automatic but I can not seem to get the page to handle the file upload <INPUT type="file"> without stopping to browse for the filename.

The exact file to be uploaded could easily be built into the HTML but I can not seem to find a way to make that happen.  I generated a unique HTML page to include all the other form data necessary on the form but I can not seem to make the file upload automatic.

If that does not have a solution, I would like to at least have the browse open in a default folder to make it easy for the user to select the file.  That seems to be difficult also.  It keeps dropping back to Documents.  

General Environment will be out of my control except to say that the local computers will be running Windows XP or Windows 7 machines so I need to program to a model that will not be an issue in various browsers and versions of browsers.

<FORM NAME="form1" ACTION="service information" METHOD="POST" ENCTYPE="multipart/form-data">
Select File to Upload:
<INPUT TYPE="file" NAME="uploadedfile">
</FORM>

Stripped out everything but the bits that affect the upload

I have no idea if this can be accomplished with some javascript or php or if there is some additional HTML that I am missing.  Any help would be appreciated.
PHP

Avatar of undefined
Last Comment
Ray Paseur

8/22/2022 - Mon
SOLUTION
Ray Paseur

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Dave Baldwin

Ray is right, you can not do what you are asking.  Think about it.  How would you feel if you went to a web site and it automatically started uploading files from your computer?  There is no way to make an exception to this in a web browser.
Ray Paseur

If you can get the client to install an application, you might be able to make this happen.  The app could be triggered to start an upload.  I do not know how to do this, but I expect it is feasible.  Of course your clients would have to trust and deploy the app, knowing that it could access any file on the computer.  Personally, I would not deploy the app.
ASKER CERTIFIED SOLUTION
Dave Baldwin

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
nlpalmquist

ASKER
I appreciate the input.  I figured as much, that I would need additional software or something to handle such an issue.  It would be nice if I could at least get them in the right folder to select the appropriate file, but I have added instructions on the web page to make that easier for them.  I was just hoping that I could make it as simple as possible, but security is also important.

Thanks for the prompt answers.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
Ray Paseur

DropBox might be a really good answer to the issue.

Thanks for the points and thanks for using EE, ~Ray