0

is it possible to read/write from/to a txt file using JavaScript, and this file be uploaded to the server and anyone can access it, literally saying, using this txt file as a database?

NOTE: I don't mean the browser's side, I mean to the same place the website is uploaded "the server's side"

geekslot
  • 213
  • 1
  • 4
  • 11
  • Not just with js code, you would need some server implementation also. – Jon Taylor Feb 24 '14 at 01:10
  • It would be possible to download the file into browser, edit the file in JavaScript and upload to server as text. Server would need to be set-up to accept text and create the file. There must be a better way though. What's wrong with a database? – kravits88 Feb 24 '14 at 06:31

1 Answers1

0

you will have to use http communication with your server handling storage

heres how it can be implemented

<form enctype="multipart/form-data" action="/upload/image" method="post">
    <input id="image-file" type="file" />
</form
Community
  • 1
  • 1
actual_kangaroo
  • 5,971
  • 2
  • 31
  • 45