Why posting the request directly returns a invalid argument error but saving the request to the filesystem first and then posting it doesn't?

Comments

1 comment

  • Avatar
    Thomas Gurung

    Hi Duta,

    Thank you for reaching out. 

    In your first code snippet you are not extracting the temporary file path so try again with this:

    const file= req.files.image.path

    When you just request `req.files.image`, you get the json response with the details of the file and uploading that results in `ERR_INVALID_ARG_TYPE`.

    Please let me know if you have any other questions or queries.

    Kind Regards,
    Thomas

     

    0
    Comment actions Permalink

Please sign in to leave a comment.