Shop OBEX P1 Docs P2 Docs Learn Events
Best way, FTP or Http Post Request? — Parallax Forums

Best way, FTP or Http Post Request?

MoskogMoskog Posts: 554
edited 2019-09-15 17:38 in General Discussion
Hello there!
I do have some html-files on servers on the Internet. Some of them displays data using .js-files served from my local client. A big problem is that my ip-address is dynamic and can change each time my router gets rebooted, and maybe some other times too. So I'm depending on DYN DNS to keep track of the current ip-address. For a better solution (and not having to waste money on the DNS-server) I been checking out the possibility of letting the client do its own transfer of the .js file to the remote server. (FTP) Have to admit I found it a bit tricky and no luck so far.

So I been using some time lately checking out HTTP Post Requests. Here I have some questions as I'm not much familiar with the HTTP and find much of the explanations on the web a bit unclear.
So first, can I really transfer a file, like .ja or .xml, from my own client and place it on the remote server, on the same directory as the html-file, using HTTP Post?
If not it's that simple and I need to send the updated data included in the URL, how will the server-side file that receive that data look like, so it again can be updated and read by the html-file?

The data files, mostly weather data, contains maybe some 70 parameters and should be sent once in a minute.

Thanks.

Edit: Forgot to say I'm using Spinneret and a Nano (something chinese I think) as client.

Comments

  • "So first, can I really transfer a file, like .ja or .xml, from my own client and place it on the remote server, on the same directory as the html-file, using HTTP Post?"

    This poses a huge security risk to the server and is not allowed. Only the server can read and write files to it's own directory. I suppose you could send a file to the server, and have the server then write the file, but it would still be irresponsible programming and expose the server.
  • OK, I see.. so the Post request is definitely not the way to go in this case.
    No problem, I better get back to the file tranfer protocol.
    Thanks anyway.
Sign In or Register to comment.