# JetEngine

This tutorial helps you get the file upload from the JetEngine plugin into the FileBird folders via JetEngine Form.

1. Go to JetEngine -> Forms to create a form.
2. Navigate to Field Settings.&#x20;

* In the Type field, please choose **Media**
* Name **File\_upload** in the name field or any name that your users can recognize its purpose.
* You can choose who can see, and upload the files in the User Access setting.
* Input the maximum allowed files to upload.
* Choose which type of MIME you allow to upload into the form, and so on...

<figure><img src="/files/0NFJzUFz80DYiOlOjAAn" alt="create a upload file form in jetengine "><figcaption><p>Create a Form in JetEngine</p></figcaption></figure>

3. Use Browser Inspector to get the FileBird's folder ID, which will be used to add the files after the form submitted. <br>

<figure><img src="/files/XtXhVUR2FHpRnpn4hxhh" alt=""><figcaption><p>How to get the FileBird's folder ID</p></figcaption></figure>

4. Add the functionality to integrate FileBird with JetEngine Form. You might use WPCode or add it to the theme functions.php

```
use FileBird\Model\Folder as FolderModel;

add_action('jet-engine/forms/handler/after-send', function($data, $success ){
	$files = $data->form_data['file_upload'];

	if (is_array($files)) {
		foreach ($files as $file) {
			FolderModel::setFoldersForPosts($file['id'], 168);
		}
	} else {
		FolderModel::setFoldersForPosts($file['id'], 168);
	}

}, 10,2);
```

\
That's it. Now, you have all the uploaded files in the FileBird Media Folder successfully.

{% hint style="danger" %}
Note: In this function, we get the file upload from the field “file\_upload” in $data->form\_data\[‘file\_upload’], the “file\_upload” must be the same name with the field we created above, and the FileBird's folder ID is ‘168’.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ninjateam.org/integrations/jetengine.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
