Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

316
Views
How to upload a video to JW Dashboard using NodeJS?

How can I upload a video to JW Player Dashboard? I need to use their fetch API.

This is what I did so far:

const express = require('express');
const multer = require('multer');
const cors = require('cors');

const app = express();
const port = 5000;

app.use(cors());

const storage = multer.diskStorage({
  destination: function (req, file, cb) {
    cb(null, 'public');
  },
  filename: function (req, file, cb) {
    cb(null, Date.now() + '-' + file.originalname);
  },
});

const upload = multer({ storage: storage }).single('file');
app.post('/upload', function (req, res) {
  upload(req, res, function (err) {
    if (err instanceof multer.MulterError) {
      return res.status(500).json(err);
    } else if (err) {
      return res.status(500).json(err);
    }
    return res.status(200).send(req.file);
  });
});

const JWPlatformAPI = require('jwplatform');

const jwApiInstance = new JWPlatformAPI({
  apiKey: 'FWWPXWdI',
  apiSecret: 'NvP2YCo5iXTqGQOKhWnOQ7aE',
});

const filePath = './public/test.mp4';

jwApiInstance
  .upload(
    {
      title: 'My new video!',
      method: 'fetch', // fetch method option
    },
    filePath
  )
  .then((resp) => {
    console.log(resp);
  })
  .catch((e) => console.warn(e));

app.listen(port, () => {
  console.log(`Example app listening at http://localhost:${port}`);
});

I need to upload a video file and then retrieve it in order to display it on my front end.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!