You are not logged in.

#1 Re: Tips, Tricks and Tutorials » Touch screen for NanoDLP » 2018-01-10 13:46:42

juliendelnatte wrote:

File in bin folder are transformed from src by gulp, and gulp will transform "await" instruction in promise,...



return (0, _requestPromiseNative2.default)({
                  uri: '${this.serverURL}/plate/add-usb'
                  formData : {
                    ZipFile : {
                      value: '/media/usb0/test123.stl',
                      options :{
                        filename : 'test123.stl'
                      }
                    },
                    Path : "test123",
                    ProfileID : 2
                  },
                  enctype: 'multipart/form-data',
                  method : "POST",
                  timeout: 10000
                });



The result is like this: Please help me

Promise {
  _c: [],
  _a: undefined,
  _s: 0,
  _d: false,
  _v: undefined,
  _h: 0,
  _n: false }

#2 Re: Tips, Tricks and Tutorials » Touch screen for NanoDLP » 2018-01-09 12:07:43

juliendelnatte wrote:

The code to upload a zip or something else look like this : (where buffer is the file content)

let result = await request({
        uri: `${this.serverURL}/plate/add`,
        formData: {
          'ZipFile': {
            value: buffer,
            options: {
              filename: 'exportFromMockaSlicer.zip'
            }
          },
          'Path': "exportFromMockaSlicer.zip",
          'ProfileID': 1
        },
        method: "POST",
      });

The await command is known to work with the node js 7.x version.
Thanks for the answer.
My Raspberry Phonode js version is 6.4.
If you check the version with node -v after updating the latest version, 6.4
If you check with nodejs -v, you will see 8.9 (8.x version installed).
I still can not upload files ^^;

#3 Re: Tips, Tricks and Tutorials » Touch screen for NanoDLP » 2018-01-08 07:07:29

I would like to upload files.
How do I run the commands in node.js to upload to the nanodlp.db db?

I want to know the code to be uploaded when the submit button on the add-usb page is clicked.

Or are there sites or links to reference?

Board footer

Powered by FluxBB