API File Upload Action - NodeJS & PHP [Open Source]

It will not show up in the extensions in settings, from what I know.
But it will show up when trying to add a new step in server action.

What does your tree look like. Did you create the folders in your project as instructed? And copied files into that folder?

@sid The files are in the node_modules folder of my Wappler app, but still the extension is not showing up in Wappler to use.
2024-03-10 13_36_55-api-file-upload-action-nodejs-master

Node_modules is secondary. You need to have the extension files in the extensions folder.

Ref:

This gets even weirder. The extension shows up in the extensions folder:
image
But the Extension is not showing up in the Server Connect editor:

The files seem to be in the right place. Not sure why the extension is not showing up for you now.
@Teodor Any ideas?

@sid @Teodor Any possible update on this? I really need to be able to upload files through API.

Is the extensions folder in the root of your project folder? I see that the screenshot you have posted is just a search result.

Maybe share the tree view of file manager from Wappler.

@sid It will be much easier if you pack and publish the extension to npm for automatic install, see:

1 Like

I tried to do it when you first released it, but was just able to create my NPM account, and could not find time to do other steps. :sweat:
Hopefully soon.

1 Like

ā€œ\supplier-prod\node_modules\api-file-upload-action-nodejs-master\extensions\server_connect\modules\FileUploadModule.hjsonā€

This is how the file is setup in the project folder. Should there be another way?

Thats wrong.
It should be in the ROOT of your prohect:
supplier-prod\extensions\server_connect\modules\FileUploadModule.hjson

That’s what I was thinking as well expect that my ROOT doesn’t have an extensions folder. Should I manually create this?

Yes. You did not read the docs it seems.
You have to create all those folders, and then paste the two files.

Good morning, does the module still work in current versions of Wappler? I installed it and the node-fetch and form-data dependencies, but whenever I try to send the form it shows an error, as if the node-fetch extension was installed, I have the application in Docker, I have already deployed it and I restarted the wappler and nothing.

Edited: I fix it by installing version 2 of node-fetch, now I’m having problems searching for the file it seems

Edited: Solved, I changed to sending one file at a time, the problem was only happening with the multi

Hi. The module does have some issue with node-fetch version.
I don’t recollect exactly, but I have seen it in one of my projects as well. But because it was a long time ago, I don’t remember.
And, unfortunately, I never updated this published version.

@sid This extension looks great but unfortunately I need what @karh mentioned in order to create an image object using square API cause the JSON is nested.

{
    "idempotency_key": "7ee7655a-8d0b-4438-a6ad-2221a6ff0090",
    "image": {
      "id": "#image",
      "type": "IMAGE",
      "image_data": {
        "caption": "caption",
        "name": "name"
      },
      "present_at_all_locations": true
    },
    "is_primary": true
  }

Very nice though!

It can be done by modifying the extension most likely. But I don't think JSON data and files can be submitted. Will add this to my to-do.

One of the devs on team was able to test this Square API.
Turns out, requests with file and data, does not support JSON. So the API here is actually expecting the JSON data to be sent as a key-value pair.

For this, you can create your JSON in a set value, and then bind it in the input data section like so:
image

Here, the toJSON() formatter is use to stringify the JSON, so that its not converted to actual JSON.

Thanks @sid I'll give it a try!