When I copy and access a link of a PDF File in Strapi Media Library web browser shows 404 status

110 views Asked by At

I use Strapi Headless CMS to upload PDF files. I copy the link of a pdf file as in below image. But when I go to the copied link it gives me below URL as result (the result is a 404 status):

https://ict-with-manjula-server.onrender.com/uploads/Clean_Architecture_A_Craftsman_Guide_to_Software_Structure_and_Design_ae5679105c.pdf

enter image description here

And also below is my API. I want to download pdf files to mobile phone using this API. I use flutter.

https://ict-with-manjula-server.onrender.com/api/file-resource?populate=theory,theory.concepts_of_ict,theory.introduction_to_computer,theory.data_representation,theory.fundamental_of_digital_circuits,theory.operating_systems,theory.data_communication_and_networking,theory.system_analysis_and_design,theory.database_management,theory.programming,theory.web_development,theory.internet_of_things,theory.ict_in_business,theory.new_trends_and_future_directions_of_ict,revision,revision.concepts_of_ict,revision.introduction_to_computer,revision.data_representation,revision.fundamental_of_digital_circuits,revision.operating_systems,revision.data_communication_and_networking,revision.system_analysis_and_design,revision.database_management,revision.programming,revision.web_development,revision.internet_of_things,revision.ict_in_business,revision.new_trends_and_future_directions_of_ict,past_papers,past_papers.year_2010,past_papers.year_2011,past_papers.year_2012,past_papers.year_2013,past_papers.year_2014,past_papers.year_2015,past_papers.year_2016,past_papers.year_2017,past_papers.year_2018,past_papers.year_2019,past_papers.year_2020,past_papers.year_2021,past_papers.year_2022,past_papers.year_2023,model_papers

I use PostgreSQL in Strapi as database. To deploy Strapi I use reder.com.

I tried to copy the link of the pdf file that I uploaded in Strapi. It gives a 404 Status. It does not open a pdf file.

I want to open the pdf file when I access the copied link of the file. Also I want to open the pdf file when I click the "url" field in the API.

1

There are 1 answers

0
Ramod Sasanga On

I solved this problem. In my strapi directory I removed the "public/upload" from the .gitignore file.