I have a HTML form with a file upload field and a text input field (eg. a PDF upload field and its description). I want to store the PDF file on AWS S3, but save the description in MySQL on my server. If the form is
<form action="http://my.server.com/upload_file/">...</form>
the PDF file will go to my server, and my server then store it on S3. But what I want is, the file go to S3 directly. I know I can set the form to
<form action="https://s3-bucket.s3.amazonaws.com/" method="post">...</form>
to directly upload file to S3, but after that, I can’t get the file description from my server. Please help me to find out the best method to do it.
Thank you very much for any advice!
you could do an ajax-request and get the description from the textfield and send it to you server.
1.handle the onsubmit-event
2.get the input
3.send ajax to server