How to store file with : / ? in its name?


#1

I tried to POST a file with slug: %24%3A%2FStoryList which is from encodeURIComponent(), but Response is The name of new file POSTed may not contain : | or /

When I encodeURIComponent it twice, then POST with slug: %2524%253A%252FStoryList, it Response with PUT not supported on containers, use POST instead

So what is the proper way to escape illegal characters in the filename?


#2

Is this related with Error saving back: Error: Web error: 409 (Conflict) on PUT


#3

I know why, POST in the NSS just call PUT to do the actual job:

async post (host, containerPath, stream, { container, slug, extension }) {
    await ldp.put(putUrl, stream, contentType)
}
...
async put (url, stream, contentType) {
    // PUT requests not supported on containers. Use POST instead
    if ((url.url || url).endsWith('/')) {
...
}

And PUT check whether slug ends with /

And this / is added here: