I am getting request timeout error even for 6kb image while uploading on cloudinary . Here is my cod

Rimjhim_Jain Member Posts: 3


import DatauriParser from 'datauri/parser.js';

import path from 'path';

const storage = multer.memoryStorage();

const multerUploads = multer({ storage }).single("file");

const dUri = new DatauriParser();

const dataUri = req => dUri.format(path.extname(req.file.originalname).toString(), req.file.buffer);

export {multerUploads,dataUri};


import app from "./app.js";

import { multerUploads, dataUri } from './multer.js';

import cloudinary from 'cloudinary';


        cloud_name: process.env.CLOUDINARY_CLIENT_NAME,

        api_key: process.env.CLOUDINARY_CLIENT_API,

        api_secret: process.env.CLOUDINARY_CLIENT_SECRET,

        secure: true,


app.post('/upload', multerUploads, (req, res) => {

    if (req.file) {

        const file = dataUri(req).content;


        return cloudinary.v2.uploader.upload(file).then((result) => {

            const image = result.url;

            return res.status(200).json({

                message: 'Your image has been uploded successfully to cloudinary',

                data: {




        }).catch((err) => res.status(400).json({

            message: 'someting went wrong while processing your request',

            data: {







    console.log(`Server is working on port: ${process.env.PORT}`);



  • epasos
    epasos Member, Cloudinary Staff Posts: 21

    @Rimjhim_Jain Kindly ensure that the cloudinary config parameters can be loaded from the .env file. You may check out this documentation for additional information on uploading to your Cloudinary account using Multer. Please take a look and let us know of any further issues. Thanks,

  • Rimjhim_Jain
    Rimjhim_Jain Member Posts: 3

    I have directly use the parameters then also it is giving the same error.

    { message: 'Request Timeout', http_code: 499, name: 'TimeoutError' }

  • Rimjhim_Jain
    Rimjhim_Jain Member Posts: 3

    I got the solution, just use another wifi network.

  • johnr
    johnr Member Posts: 7

    Great to know that you solved it already @Rimjhim_Jain!