When uploading a file with special chars as name, I see a 403 error "Access denied".
As I can upload files with a different name, I assume it's not actually a permission problem.
The input.Name is a.b/c;6
I try to encode the name to remove the special chars. I did something similar with pnpjs and the following logic worked for nodejs
func encName(s string) string {
replacements := map[string]string{
`"`: `%22`,
`*`: `%2A`,
`:`: `%3A`,
`<`: `%3C`,
`>`: `%3E`,
`?`: `%3F`,
`/`: `%2F`,
`\`: `%5C`,
`|`: `%7C`,
}
for k, v := range replacements {
s = strings.ReplaceAll(s, k, v)
}
return s
}
Is it possible, that the % is not properly encoded when making the call and some weird url is made?
When using the following replacements, it is working fine
When uploading a file with special chars as name, I see a 403 error "Access denied". As I can upload files with a different name, I assume it's not actually a permission problem.
I add the file with the following code
The
input.Name
isa.b/c;6
I try to encode the name to remove the special chars. I did something similar with pnpjs and the following logic worked for nodejsIs it possible, that the
%
is not properly encoded when making the call and some weird url is made?When using the following
replacements
, it is working fine