i have this form on uploading a file, but i cant seem to set the path where to save the file to be uploaded. How can I upload the file to specified folder? take note: using, possibly, javascript
Here is my code:
<form method="post" action="file-upload-1.htm" name="submit" enctype="multipart/form-data">
<input type="file" name="fileField"><br /><br />
<input type="submit" name="submit" value="Submit">
</form>
For saving a file on the server you always need a server side component to save the file, there is no way to build a client-only solution.
Imagine: Everybody could tell their client to store files on your server otherwise. :-)
You can only specify variable information from the front-end/HTML side. To control what happens once the file reaches the server you need to do this via your server side code. I have included a few examples below for how to accept and save a file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With