Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Specify File upload path

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>
like image 490
web application Avatar asked Mar 17 '23 03:03

web application


2 Answers

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

like image 119
hoeni Avatar answered Mar 30 '23 13:03

hoeni


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.

  • PHP
  • ASP.NET
like image 38
Shawn Lehner Avatar answered Mar 30 '23 12:03

Shawn Lehner