# Download a file through a signed URL

> temporarySignedRoute plus the signed middleware. An Inertia Link cannot download the file. Use an anchor.

- URL: https://laravel-vuejs.space/laravel-signed-download-vue
- Author: Anass Ez-zouaine (https://laravel-vuejs.space/author/anass-ez-zouaine)
- Published: 2026-10-11
- Topics: Laravel, VueJs

People searching “Laravel signed download Vue” put the storage path in the Vue page. Generate a short-lived URL and check the policy anyway. A leaked link should expire, and it should still fail for the wrong user. The [upload guide](https://laravel-vuejs.space/laravel-vue-file-upload) is how the file got there.

> **TL;DR**
>
> -   temporarySignedRoute plus the signed middleware.
> -   An Inertia Link cannot download the file.
> -   Use an anchor.
> -   Do not put the signature on a public disk URL and skip `can('view')`.
>
> **Who it's for:** Laravel + Vue developers
>
> **Applies to:** Laravel 13 · Vue 3

## The fix

```php
public function show(Request $request, Post $post): Response
{
    $this->authorize('view', $post);

    return Inertia::render('posts/Show', [
        'download' => URL::temporarySignedRoute(
            'posts.download',
            now()->addMinutes(5),
            ['post' => $post->id],
        ),
    ]);
}
```

```php
Route::get('/posts/{post}/download', function (Post $post) {
    abort_unless(auth()->user()?->can('view', $post), 403);

    return Storage::disk('local')->download($post->cover_path);
})->middleware(['auth', 'signed'])->name('posts.download');
```

```vue
<a :href="download">Download</a>
```

`<Link>` expects an Inertia response. A file is not one, so the browser should navigate with a normal anchor.

## What to avoid

> **Gotcha**
>
> Do not put the signature on a public disk URL and skip `can('view')`. The signature proves the URL was not edited. It does not prove this user may have the file.

## FAQ

**Q: How do I download a file through a signed URL?**

temporarySignedRoute plus the signed middleware. An Inertia Link cannot download the file. Use an anchor.

**Q: What goes wrong with Laravel signed download Vue?**

Many developers put the storage path in the Vue page. Do not put the signature on a public disk URL and skip `can('view')`.
