-
Notifications
You must be signed in to change notification settings - Fork 42
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
Proxy Issue with GetBuffer of a file with PNP-JS #61
Comments
Hey @Korigoth, Experiencing issues with making But, I can offer another approach for achieving what you need in your original question in PnPjs repo, which works with the proxy (the method even faster as it copies files on server-side): const templateUrl = '/sites/site/Templates/Template.xlsx';
const targetUrl = '/sites/site/Documents/NewDocument.xlsx';
web.getFileByServerRelativeUrl(templateUrl)
.copyTo(targetUrl)
.then(templateData => {
return web.getFileByServerRelativeUrl(targetUrl).getItem();
})
.then(item => {
return item.validateUpdateListItem([
{ FieldName: 'Title', FieldValue: 'Some title' }
], true);
})
.then(console.log); Also, please update |
@koltyakov error: /sites/app/template/Forms/document/test.docx so in our case, i think the method getBuffer() is the way to go |
I was able to make getBuffer works. |
The update is published, ver 2.7.4. |
@koltyakov |
Great! |
We have an issue while using PNP-JS and SP-Rest-Proxy.
We are trying to get a Template we have created (Content-Type) (docx).
And upload it in it's content library.
The file uploaded in the lib is always corrupted.
I doesn't know if it the getBuffer() method that get a corrupted stream
or the add() method that corrupt the item while being uploaded with the proxy
Here is the code we use for the file
Here is the code we use for the Proxy Settings
The issue discussion started here => pnp/pnpjs#196
The text was updated successfully, but these errors were encountered: