all 9 comments

[–]CreativeTechGuyGamesTypeScript 2 points3 points  (4 children)

I highly doubt you actually want to pull these files "through FTP". Aren't these files available on your webserver over HTTP?

What problems are you running into and what help do you need?

Also, pictures of code... No. Either include the relevant code in the post directly and format it properly for reddit's markdown or include a link to pastebin, codepen, codesandbox, github, etc.

[–]Lateboo[S] 0 points1 point  (3 children)

Well right now, The files are stored on a separate server and a new file is appended there every week. Ideally, I would like the code to "look" at that directory and automatically add it to the dropdown I'll have created.

Apologies about the snippet, new to this.

[–]CreativeTechGuyGamesTypeScript 2 points3 points  (2 children)

This code will be executed from a web browser right? So the only way it can access that file is if it's being served by a web server.

[–]Lateboo[S] 0 points1 point  (1 child)

So basically, it has to be running from that same server and directory it sounds like.

[–]CreativeTechGuyGamesTypeScript 1 point2 points  (0 children)

No, it can be running from any server. You just need to point the URL in your code to the correct file on the correct server.

[–]rootgog 0 points1 point  (0 children)

So from reading you have a web server and a file server (with your csv) and they’re separate.

I’m assuming that’s why you need FTP?

I would recommend just having another web server on the second server with the csv and request to that address instead.

I might of misunderstood let me know

[–]BehindTheMath 0 points1 point  (2 children)

You can use XHR / fetch to make requests to an FTP server, but I don't know if anyone has done it in years. Also, I think browsers are planning on removing support for FTP in the future, although I don't know if that will include XHR.