Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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!
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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!
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
@AYSNandhini Hi, what package did you use? Can you point to me the npm module you used?
Copy link to clipboard
Copied
Can you share full code?
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more