Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create attachment but not correct content file #8

Open
nguyenphudung93dn opened this issue Mar 15, 2024 · 2 comments
Open

Create attachment but not correct content file #8

nguyenphudung93dn opened this issue Mar 15, 2024 · 2 comments

Comments

@nguyenphudung93dn
Copy link

SDK xero-node Version 5.1.0

Describe the bug
I tested API with this code:

const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file
const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file
const contentType = mime.lookup(fileName);
const response = await xero.accountingApi.createInvoiceAttachmentByFileName(xeroTenantId, invoiceID, fileName, body, includeOnline,idempotencyKey, {
headers: {
"Content-Type": contentType,
}
});
But result: File uploaded but not content
Screenshot 2024-03-13 at 16 15 47

Copy link

PETOSS-405

Copy link

Thanks for raising an issue, a ticket has been created to track your request

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

No branches or pull requests

1 participant