Based on the error message, there could be several potential causes. Assuming you're using a script similar to the one provided on the following page, here are some possible reasons:
Incorrect URL or Subdomain: Double-check that the URL is correctly replaced with the actual subdomain of your Kintone instance.
Missing or Invalid Request Token: Ensure that kintone.getRequestToken() returns a valid token.
Permissions and API Token: Verify that your API token or the user associated with it has the necessary permissions to upload files.
CORS and Headers: Make sure that the X-Requested-With header is correctly set to comply with CORS policies.
Blob and FormData: Confirm that the Blob and FormData objects are correctly created and formatted.
I'm not entirely clear on your question, but if you're referring to uploading a file to Kintone using "https://{subdomain}.kintone.com/k/v1/file.json," please note that this action does not upload the file to an Attachment field of an App.
To upload the file to an Attachment field, you will need to use the fileKey with the Add Record or Update Record API as noted on the help page.