Closed aungpyaekyaw closed 2 years ago
I found the workaround for expiresIn option.
You can pass a function to preCompute option in model instead of boolean value.
The model
{
@attachment({ preComputeUrl: preCompute, disk: 's3'})
public attachment: AttachmentContract
}
A custom pre-compute function.
async function preCompute(disk: DriverContract, attachment: AttachmentContract) {
return disk.getSignedUrl(attachment.name,{expiresIn: '5hr'})
}
You can pass a function to preCompute option in model instead of boolean value.
That's the way to go
Why this feature is required (specific use-cases will be appreciated)?
Currently we cannot set custom expire time for signed url with preCompute option. Is it possible to add expiresIn option when using pre computed url.
Have you tried any other work arounds?
Not yet.
Are you willing to work on it with little guidance?
Yes.