4

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>

2 Answers 2

5

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. :-)

Sign up to request clarification or add additional context in comments.

Comments

2

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.