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

theUnforgiven's avatar

SignaturePad and Vapor

Hi all,

I have the following code in my controller:

$imageURI = $request->signature;
$path = 'signatures/'.user()->id;
$outFile = time() . '.jpg';
$output = base64_to_jpeg($imageURI, $outFile);
$file = Storage::putFile($path, $output);
Storage::setVisibility($file, 'public');

This works fine and uploads to S3 fine, but when on staging server which is on Vapor, I get an error: fopen(1587492857.jpg): failed to open stream: Read-only file system Why would this be and how can I overcome it so this works as it does locally?

0 likes
3 replies
theUnforgiven's avatar

My vapor.yml file as follows:

staging:
        gateway-version: 2
        memory: 1024
        cli-memory: 512
        storage: file-assets
        queue-concurrency: 50
        runtime: php-7.4

Using this works for other uploading, it just seems to be the code I initially posted, that is the problem.

theUnforgiven's avatar

Although this uploads to S3 locally, I've found it's actually storing the file in public/the-file-name.jpg also. So my guess would be the Storage::putFile is wrong or something.

Anyone else fancy chipping in?

theUnforgiven's avatar

Anyone know why this wouldn't work please, I still haven't found a solution

Please or to participate in this conversation.