Reputation: 51
I am quite new to this technology. I need to know how to upload a file to an FTP server using angular 2. Any code snippets? Any tutorial pages? I have searched exhaustively, but I dont have a working, good example to try. Thanks in advance. Please help.
Upvotes: 4
Views: 9213
Reputation: 134
direct FPT call is not supported JS, what you can do here
In above link you can see example of C# to FTP server
Upvotes: 0
Reputation: 14087
AFAIK, Angular 2 doesn't offer a specific solution for uploading files.
But Angular is just JavaScript, so your question really is "how to upload files in JavaScript".
You have two main options:
Using the File API. See the very clear File API documentation on MDN (with plenty of code examples). This API is part of HTML5 and older browsers may not support it. In that case, you might have to use one of these polyfills.
Using a third-party library. There are open-source libraries (e.g. http://www.dropzonejs.com/) and paying libraries (e.g. https://www.filestack.com/). A Google search will reveal more options.
Upvotes: 1