Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Socket hang up error with nodejs in indesign2015

New Here ,
Apr 19, 2019 Apr 19, 2019

Hi,

I want to upload file and download files from server with adobe cep indesign extension.. i have done by using nodejs..

nodejs request.get() and request.post() works fine in indesign 2017 and above..

but in indesign cc 2015 returns "socket hang up" error..

how to fix it?

and any other configuration for use nodejs in indesign cc2015

this is my sample code,

var FormData = require('form-data');

var request = require('request');

options = {

        url:uploadUrl,

        formData: formData,

        headers:headers,

strictSSL: false,

rejectUnauthorized: false,

    }

    request.post(options, function(err, httpResponse, body) {

    if (err) {            

       showDlg('Upload failed');

    }

    else {

                showDlg("Upload successfully");               

                 }

             }

    });     

Pls help

3.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Apr 19, 2019 Apr 19, 2019

Hi Aysnandhini!

This is a compatibility problem. Please refer to these two charts. InDesign 2015 uses CEP 6, which is only compatible with Node IO.js 1.2.0.

Unfortunately, I don't know enough about Node to solve your problem, but hopefully this will point you in the right direction. You might also want to check out our article on running a Node server in a panel.

Best of luck!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 28, 2019 Apr 28, 2019

Hi,

I have checked Node IO.js 1.2.0​ doc link.. i have used request module for upload a file but there is no explanation about request module in 1.2.0 doc link i think request module does not support in that nodejs version.. but https.request support by cc2015.. do you have any idea for upload a file/files using https.request?

Thank you

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
May 03, 2019 May 03, 2019

Hi there,

So... I asked around and perhaps there is nothing particularly special about htts.requests in CC 2015. Have you had any luck following basic HTTPS file upload guides like this one?

Let us know if you've made progress!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 07, 2019 Jun 07, 2019

Hi,

sorry for the late reply.. i finally did it with nodejs. because https file upload, fetch API not worked in my case..

ErinF​ your reply very helpful to me.. yes it is compatibility problem..

request module did not worked in cc2015

so i have used https.request with form-data module

and add file like

var fm = new FormData();  

fm.append("file",fs.createReadStream(path));

var req = https.request(options);

fm.pipe(req);

req.on('response', function(res) {

     alert(res);

});

finally this code worked from cc2015 to cc2019

Thanks

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 01, 2023 May 01, 2023

@AYSNandhini Hi, what package did you use? Can you point to me the npm module you used?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 01, 2023 May 01, 2023
LATEST

Can you share full code? 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines