You need to obtain an access token
The file data needs to be a base64 encoded string
To attach a file to a Salesforce record:
// ParentId is the SObject of the record you're attaching a file to
// body truncated for brevity; replace with base64 of your file
Notes and Attachments are two different objects, like Tasks and Events are located in Activities. You can use /services/data/v50.0/sobjects/Note to get "classic" notes, and /services/data/v50.0/sobjects/ContentNote to get the new Enhanced Notes. Querying Attachments will only show files.
One way to achieve this would be to examine the field metadata on all sObject types that you can access. You are looking for any field that has the base64 data type. That would have a capacity to store file date (in theory at least).
This is true for:
I also found:
It is easy once you understand the Data Model.
You have the CaseFeedItem already in your system. Use this to Query for the Feedattachment. This can be done through the REST API
/services/data/v51.0/query/?q=SELECT Id, RecordId, Type FROM FeedAttachment WHERE FeedEntityId = 'some_feedItem_id'
Once you have the FeedAttachment use the RecordId and Type to ...
This is technically possible, not not really practical or feasible.
PDFs and .docx files are complex beasts. PDF is probably the simpler of the two, but it's still not something that you can just grab text out of. docx has the additional complications of being a zipped directory containing xml (for the "main" sub-file in the document).
Apex doesn't ...
There is no alternative $A.get('e.force:refreshView').fire(); in Lightning Web Component which has the capability to refresh the standard component. You need to make use of Aura Component to fire refreshView event whenever you apex execution is done in your lightning web component by firing an event which will be listened by Aura Component.
A sample example ...
Please consider using AppExchange free solutions. SF files structure is not as simple as it usually looks. See the three options that SF gives here and see if they are going to fit your needs.
If you decide to go with custom code I can also give you some pointers, but I would leave that as a ...