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

PDF file upload existing record using node js #57

@RGKrish183

Description

@RGKrish183

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions