0
votes

I want to create a form in which i have some textfields and a field for a file upload. In the action i upload the file first, and then save the values from the textfields in my database.

For a file upload I need enctype="multipart/form-data" and then it works but the other things does not work. when i take the default enctype the data save works but the file upload failed.

What should I do?

1
How are you processing the form? ASP, PHP, CGI?nachito
Do you have separate uploads? Do you use ajax calls when posting the form? Please elaborate, preferably with some code...kasimir
enctype="multipart/form-data" will not affect the value in your textarea. I think we can check it further if you could post more codesuser900202

1 Answers

0
votes

Any HTML source?

The enctype should also POST the textfields to the server. Make sure you access the file by $_FILES and the other data by $_POST.

You do need enctype="multipart/form-data".

If theres still something wrong, it's not in your HTML.