Creating .meta file error

Hello,

I tried to create a file with metadata using solid-file-client.
I also read from the article How to create a meta file that we should access metadata file as a regular file.

So I use the JavaScript code below to create a metadata for an existing file.
The existing file’s path is the variable filePath.

let {meta: metaUrl} = await fc.getItemLinks(filePath, {links: 'include_possible'});
await fc.postFile(metaUrl, JSON.stringify(content));

However, I got an error stating “403 (POST is not allowed for auxiliary resources)”.
Plus the code used to work two months ago.
Did I miss any updates on the metadata side?

Thanks in advance for your help,

Amos Wu

Currently, AFAIK, NSS only supports .meta files for containers, not for resources. The spec definitely supports them on resources, but it hasn’t been implemented yet.

Additionally, POST can not be used on auxiliary resources (.meta,.acl), you must use PUT, which in solid-file-client, would be createFile and/or updateFile.

Forbidding POST on aux resources was only implemented recently, so that may be the difference for you.

1 Like

Thank you for your reply.

I would like to ask another question.
Does .meta file has limited content types?

I tried to use createFile to create the .meta file.
However, I got “415 (Unsupported Media Type)”.
The content type of my file is application/json.
I think this might be the case that causes the error?
But if we can treat .meta file as a regular file, the content type should be any possible type?

Thank you,

Amos Wu

The specification says that the auxiliary resource must be RDF. So application/json (which is not necessarily RDF) would not be acceptable, although application/ld+json (which is an RDF representation) may be, depending on the server.

1 Like