Skip to content
This repository has been archived by the owner on Jul 19, 2022. It is now read-only.

PDF file upload existing record using node js #57

Open
RGKrish183 opened this issue Oct 24, 2017 · 1 comment
Open

PDF file upload existing record using node js #57

RGKrish183 opened this issue Oct 24, 2017 · 1 comment

Comments

@RGKrish183
Copy link

Hi,

I have one file upload field. use node js to upload pdf file in existing records. i don't have file id because not added via in front end. i just use api to upload in existing record. I don't know what is right way. i just founded and try this,

i just try source for two type things :

Note : fileconents(source of the file), local file path.

############# FIRST FORMAT #################

var filePath = '/home/hoffensoft/Desktop/query.pdf';
var file = 'query.pdf';

podio.request('post','/file/', {'source': filePath, 'filename':file}, function(response, body){
console.log(body);
}).catch(function(err) {
console.log('errors podio.request');
console.log(err);
});

But I'm getting PodioNotFoundError only. And also i have major doubt is, HOW I HAVE UPLOAD EXACTLY IN PARTICULAR RECORD, BECAUSE THERE DONT HAVE RECORD PRIMARY KEY OR SOMTHING LIKE THAT,.

############# SECOND FORMAT #################

var filePath = '/home/hoffensoft/Desktop/query.pdf';
var file = 'query.pdf';

podio.uploadFile(filePath, file, function(response){

console.log('response');
console.log(response);

}).catch(function(err){
console.log("Error");
console.log(err);
});

Below error was i'm getting

{ PodioError
at /opt/lampp/htdocs/podio/node_modules/podio-js/lib/PodioErrors.js:67:19
at /opt/lampp/htdocs/podio/node_modules/podio-js/node_modules/lodash/index.js:3073:15
at baseForOwn (/opt/lampp/htdocs/podio/node_modules/podio-js/node_modules/lodash/index.js:2046:14)
at /opt/lampp/htdocs/podio/node_modules/podio-js/node_modules/lodash/index.js:3043:18
at Function. (/opt/lampp/htdocs/podio/node_modules/podio-js/node_modules/lodash/index.js:3346:13)
at Object. (/opt/lampp/htdocs/podio/node_modules/podio-js/lib/PodioErrors.js:66:3)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
message: 'File uploads are only supported on the server right now.',
status: undefined,
url: undefined,
name: 'PodioError' }

Please kindly help and get out from this issue. Thanks in advance

@Nazaroni
Copy link

Same issue there... and for Podio with NodeJS almost zero information, that's really sad.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants