PDF files are not showing in the WordPress media library
Once I was creating a form where the user can upload a pdf document. I was able to: upload the file, see it in the uploads folder, and also get its link then access that link in the browser and get success server response.
The problem is I was not able to see my file in the WordPress media library. A few hours later, I remembered that it is not enough to upload the file but I should also insert it as an attachment. Remember: It should have a record in the database with one of the registered post types.
If you reached this page by searching about this problem, I hope I could save your time and provide the proper solution.