Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

dmag's avatar
Level 6

How to store file temporarily?

I need to make a pdf file available to a user, which can be retrieved from an external api. I don't want to expose a link to the api to user, nor do I want to download and store all those pdf files on my server.

Basically, there are two approached that I have questions about:

  1. is there a way in Laravel to mask the external link with a temporary link?
  2. or how can I get the file from external link and store it temporarily on my server to show the user and then have all those temporary pdf files removed from my server?
0 likes
2 replies
dmag's avatar
Level 6

@Sinnbeck thank you, will look into it and will get back to you. I think filesystem temporary urls work only for s3 storage.

Please or to participate in this conversation.