0

I had a research about it but the examples that I found were not clear so I couldn't understand how to save files in project folder. The library that I use requires that there should be required files in the same folder other than the main inputs. So, I have to save the uploaded files to the same folder. Can you fill the function?

<input type="file" accept="text/xml" id="myFile1">
<button on-click = "uploadFile() type="button">Upload</button>

<script>

function uploadFile(){

var file = document.getElementById("myFile1").files[0];

var location="/src/data/";

}

</script>
  • Possible of duplicate with https://stackoverflow.com/questions/13405129/javascript-create-and-save-file – Zaid Bin Khalid Jul 28 '17 at 08:47
  • Javascript doesn't live on the server, it runs on the webbrowser of your clients. To access folders on the server you need the program that runs the server, like PHP (Apache). Are you talking about a folder on the computer of the client or a folder on the server? Please elaborate – Emmanuel Delay Jul 28 '17 at 09:03
  • I need to use this files. However, the java library that I use gets only the main files as input but wants to reach the required files in the same folder. I have no idea if I can use webserver like folder or should I upload the files to the project folder. All of the solutions are OK with me. However, I don't have any idea how to do that – Hazal Buruk Aug 02 '17 at 07:48

0 Answers0