hmmm, maybe try using a controller with a response to the file so you can set correct headers. Read this section.
// $headers for file type
return response()->file($pathToFile, $headers);
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I am trying to create a new File() type in an Express app that talks to a Laravel app. I am originally creating an absolute url in from a Laravel app using the following method:
$url = Storage::temporaryUrl(
$filename, now()->addMinutes(20)
);
This returns to me a browser accessible url that looks something like "https://.....";
I am then passing this to the Express microservice where I am trying to create an Image file and or Blob either will do. The code is as follows:
const imageFile = await fetch(imageUrl);
const data = await imageFile.blob();
console.log(data);
However Data always comes back empty. Has anyone had to construct a file type in express before??
Please or to participate in this conversation.