Is possible update txt file on server using JS | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Is possible update txt file on server using JS

Is possible update file on server using JS / jQuery? (Ajax?)

27th Jun 2017, 1:30 PM
Petr Vopalecký
Petr Vopalecký - avatar
4 Answers
+ 15
You can activate a PHP file editing script using JS AJAX otherwise your only option is NodeJs
27th Jun 2017, 1:39 PM
Valen.H. ~
Valen.H. ~ - avatar
+ 4
the only way to store txt files is on cloud if ur mentioning "server". i myself have a vps and u can use the fs module from node to edit it or simply just ssh into it and use a text editor like vim or nano. another form of cloud could be ftp and u can access ftp files with php and no i dont think u need any js on this one Read more here https://cheeze.club/w1dx
27th Jun 2017, 2:11 PM
David Sebastian Keshvi Illiakis
David Sebastian Keshvi Illiakis - avatar
+ 1
lol ikr ajax has nothing to do with server side file editing script whatever. ajax is basically making an http request and receiving request thus putting the results of the request on an html page without refreshing the page (without making another request again) which is useful if u want dynamic
27th Jun 2017, 2:31 PM
David Sebastian Keshvi Illiakis
David Sebastian Keshvi Illiakis - avatar
0
Javascript/jQuery is run from client pc, not from server, so it's not possible to update text file on server. You need server script program like PHP. Ajax is initiated by client Javascript to communicate with server script. Anyway you still need server script to do the server file updating.
27th Jun 2017, 2:13 PM
Calviղ
Calviղ - avatar