Comments (7)
Hi, I've taken a look but I haven't been able to reproduce. However, I was testing using Browser and not Node. So will continue to try and replicate.
from pnpjs.
Did another test and just learned that if the folder is not found (i.e. the call to getFolderByServerRelativePath returns 404) you will get back an empty array of files vs a 404 when you call folder.files().
Not sure if that is what you are seeing here, but we are otherwise not able to reproduce this issue.
from pnpjs.
Ok, figured this out but took a bit of checking. The getFolderByServerRelativePath
endpoint (and a few others) ONLY takes a non-encoded URL. So, the problem is you have %20 in the folder name... if you remove that it'll work. We will add to the docs about the endpoint needing to not be encoded.
from pnpjs.
Thanks, y'all - @juliemturner, I've converted the %20
to a space and still getting the same result.
Since we're dealing with character encodings, there is actually an underscore in the final folder directory, like:
const folder = await this.spInstance.getFolderByServerRelativePath(
"/sites/Finance/Shared Documents/Economics/Source_Reports/"
);
...but other than that, the _url
param is:
{
_url: "https://nesthealthcares.sharepoint.com/sites/Finance/_api/web/getFolderByServerRelativePath(decodedUrl='%2Fsites%2FFinance%2FShared%20Documents%2FEconomics%2FNavinet_Reports%2F')"
}
Also, I tried the folderFromServerRelativePath
logic that I see in the docs PR, and this structure:
const folderBase2 = folderFromServerRelativePath(this.spInstance, filepath);
console.log("folderBase2", folderBase2);
const folder2 = await folderBase2();
console.log("folder2", folder2);
const files2 = await folder2.files();
console.log("files2", files2);
...gives me a 404 with the same decodedUrl=
URL in the debug. I'm still a bit new to Sharepoint, but if the user has access to the file (per a file in that folder loading), would they also have access to the folder, and if not, does MS obscure 401/403 as 404 like this?
from pnpjs.
You have a trailing / in your URL.. works fine with _ in the path.
from pnpjs.
That easy - we're set, can close this whenever y'all want. Thanks for the help!
from pnpjs.
This issue is locked for inactivity or age. If you have a related issue please open a new issue and reference this one. Closed issues are not tracked.
from pnpjs.
Related Issues (20)
- version 4 - @pnp/sp/favorites doesn't exists HOT 3
- PNP/Graph Error: No observers registered for this request. HOT 9
- Some of the SharePoint Online users are not showing in the Auto Complete or People Picker HOT 5
- Taxonomy is impossible to work with in v4 HOT 2
- IItemAddResult not found in "@pnp/sp/items", nor anywhere else that I can find HOT 2
- Graph API me/OwnedObjects is missing with pnp js 3.0 HOT 3
- MS Graph Following Endpoint limited to 10 items HOT 3
- How are we supposed to work with taxonomy now? How do we get PathofTerms or Parents? HOT 2
- How to update Taxonomy field of a folder? HOT 2
- TypeError: Cannot read properties of undefined (reading 'web') HOT 22
- searchAllOrganizationUsers not searching the user with 1 or 2 characters it is working with 3 or more characters HOT 3
- Get All method is missing in the version 4 HOT 4
- Accessing different geo site gives 403 unauthorized error HOT 3
- Documentation references non-existent `ITermInfo` type HOT 1
- Aliased parameters not parsed correctly with apostrophe followed by a whitespace HOT 8
- getAllChildrenAsTree does not include an option to retrieve properties. HOT 7
- ISearchQuery is missing EnableDynamicGroups HOT 1
- Multiple file upload HOT 1
- TypeError: Failed to fetch at c when trying to upload files to document library. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pnpjs.