1

I'm using API platform with VichBundle to store file on the back side and React Native on the Front side.

I've followed the documentation of API platform and the upload part is working well, but I don't know how to download the document.

When I make a GET request I have the entity with the url of the file but I can't do a GET request with this url because there is no route to this file.

Can somebody give me an exemple of how to download file with api platform and Vichbundle.

Thanks

1 Answers1

0

If you are following Api Platfom's documentation your files should be uploaded to your project's ./app/public/media/ folder and available making an HTTP GET request to http(s)://<yourdomain>/public/media/<filename>.<extension>. Just open the URL in your browser.

To get the exact url query yout API for me mediaObject information (for example, /api/media_objects/{id}) and check the contentUrl property.

Reinventia
  • 21
  • 6