How To Upload Files To An FTP Server From Knack

Today we want to share with you how to upload files and save them in an FTP server from the Knack database through a proxy.
Please keep in mind you must have some essential conditions in order to accomplish this.
We list the following requirements:
- Have an FTP server configured
- Web server to run endpoint that will upload files to FTP
- A Knack application with an object and a form to make the post to the server
Step 1:
The first thing you need is to have the access data and credentials configured for the FTP server, which are:
- host: xxxxxxx,
- port: 21,
- user: xxxxxx,
- password: xxxxxxxx
Step 2:
Create an endpoint in NodeJS
Once you have the access data to the FTP server, the next step is to create an endpoint which will receive the file and upload it to the FTP server.
The code in the endpoint will look like this.
To see the code’s structure please enter this site:
https://github.com/SOLUNTECH/knack-ftp
Step 3: Create the app in Knack.
An object must be created containing a file type field which will be sent to the FTP Server.
Now, create a page and put a form to post to the object you just created.
Step 4
Finally, go to the JavaScript section in Knack, and add this simple code. Make sure you update the field_id with your own.
$(document).on('knack-form-submit.view_361', async function (event, view, data) {
await $.ajax({
url: `${FTP_API_SERVER}ftp`, // Endpoint URL
type: 'POST', // Method
data: { // Body JSON
file: data.field_399_raw.url,
filename: data.field_399_raw.filename
},
dataType: 'json'
})
Are you ready to implement this from your Knack App?
Let us know how it goes…..
Let’s Make IT Happen!
Soluntech Team
AI-Native Engineering Firm
Soluntech's team writes about software, AI systems, validation, and operational technology from the perspective of disciplined engineering and long-term system ownership.
Continue with related insights.
Explore more thinking connected to this topic, from software decisions to AI systems and operational execution.

What is app auditing, and how to know if your solution needs one
Imagine that you have developed an application for your business. It doesn't matter if you have done it from scratch or used a low- or no-code platform.
Soluntech Team
AI-Native Engineering Firm

Love in the Age of AI
How Artificial Intelligence is Transforming Human Relationships
Soluntech Team
AI-Native Engineering Firm

Learning Velocity: The Only Metric That Matters for AI Growth
Learning Velocity: The Only Metric That Matters
Soluntech Team
AI-Native Engineering Firm