Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This driver does not support creating temporary URLs #2155

Closed
reefki opened this issue Dec 3, 2020 · 8 comments · Fixed by #2157
Closed

This driver does not support creating temporary URLs #2155

reefki opened this issue Dec 3, 2020 · 8 comments · Fixed by #2157

Comments

@reefki
Copy link
Contributor

reefki commented Dec 3, 2020

Description

It seems that I'm no longer able to use the temporaryUrl for .jpg or .jpeg file since upgrading to Laravel 8.17.1. Probably related to this laravel/framework#35419 ?

[2020-12-03 10:40:02] local.ERROR: This driver does not support creating temporary URLs. 

Exact steps to reproduce

Upload a .jpg or .jpeg.

Stripped-down, copy-pastable code snippets

// Component

<?php

namespace App\Http\Livewire\User;

use Livewire\Component;
use Livewire\WithFileUploads;

class UserAvatar extends Component
{
    use WithFileUploads;

    public $avatar;

    public function rules()
    {
        return [
            'avatar' => [
                'image',
            ]
        ];
    }

    public function render()
    {
        return view('livewire.user.user-avatar');
    }
}
// View

<div>
    @if ($avatar)
        <img src="{{ $avatar->temporaryUrl() }}">
    @else
        <img src="{{ $user->avatar }}">
    @endif

    <input type="file" wire:model="avatar">
</div>

Context

  • Livewire version: 2.3.5
  • Laravel version: 8.17.1
  • Alpine version: 2.7.3
  • Browser: Chrome, Safari
@danharrin
Copy link
Contributor

Hey @reefki, can you check if #2157 solves your issue please? Many thanks 😄

@reefki
Copy link
Contributor Author

reefki commented Dec 3, 2020

@danharrin Oh yeah it does! Thank you so much

@squishythejellyfish
Copy link
Collaborator

👋 Oh Hi! I'm Squishy, the friendly jellyfish that manages Livewire issues.

I see this issue has been closed.

Here in the Livewire repo, we have an "issues can be closed guilt-free and without explanation" policy.

If for ANY reason you think this issue hasn't been resolved, PLEASE feel empowered to re-open it.

Re-opening actually helps us track which issues are a priority.

Reply "REOPEN" to this comment and we'll happily re-open it for you!

(More info on this philosophy here: https://twitter.com/calebporzio/status/1321864801295978497)

@randohinn
Copy link

randohinn commented Mar 11, 2021

It seems that after this was introduced, it's no longer an option to trick the local driver into doing things not enabled by default? Previously, you could have something like

  'preview_mimes' => [   // Supported file types for temporary pre-signed$
            'png', 'gif', 'bmp', 'svg', 'wav', 'mp4',
            'mov', 'avi', 'wmv', 'mp3', 'm4a',
            'jpeg', 'mpga', 'webp', 'wma','jpg'
        ],

defined, and it would happily preview videos. Now it errors with "This driver does not support temporary urls". Is there a way this extendability can be restored?

@randohinn
Copy link

👋 Oh Hi! I'm Squishy, the friendly jellyfish that manages Livewire issues.

I see this issue has been closed.

Here in the Livewire repo, we have an "issues can be closed guilt-free and without explanation" policy.

If for ANY reason you think this issue hasn't been resolved, PLEASE feel empowered to re-open it.

Re-opening actually helps us track which issues are a priority.

Reply "REOPEN" to this comment and we'll happily re-open it for you!

(More info on this philosophy here: https://twitter.com/calebporzio/status/1321864801295978497)

REOPEN

@l0gical
Copy link

l0gical commented Mar 26, 2022

👋 Oh Hi! I'm Squishy, the friendly jellyfish that manages Livewire issues.
I see this issue has been closed.
Here in the Livewire repo, we have an "issues can be closed guilt-free and without explanation" policy.
If for ANY reason you think this issue hasn't been resolved, PLEASE feel empowered to re-open it.
Re-opening actually helps us track which issues are a priority.
Reply "REOPEN" to this comment and we'll happily re-open it for you!
(More info on this philosophy here: https://twitter.com/calebporzio/status/1321864801295978497)

REOPEN

Hey, was there any further progress on this?
I have the same issue.
Chris

@davidfactis
Copy link

hi i have the same problem please help me i have on my project
"php": "^8.0.2",
laravel 9.31.0
"livewire/livewire": "^2.10"

@charliex311
Copy link

charliex311 commented Jun 8, 2023

There is Livewire's configuration available in config/livewire.php where you can configure the drivers for temporary file uploads.

'temporary_file_upload' => [
     'disk' => 'local',        // Example: 'local', 's3'              Default: 'default'
     'rules' => null,       // Example: ['file', 'mimes:png,jpg']  Default: ['required', 'file', 'max:12288'] (12MB)
     'directory' => null,   // Example: 'tmp'                      Default  'livewire-tmp'
     'middleware' => null,  // Example: 'throttle:5,1'             Default: 'throttle:60,1'
     'preview_mimes' => [   // Supported file types for temporary pre-signed file URLs.
         'png', 'gif', 'bmp', 'svg', 'wav', 'mp4',
         'mov', 'avi', 'wmv', 'mp3', 'm4a',
         'jpg', 'jpeg', 'mpga', 'webp', 'wma',
     ],
     'max_upload_time' => 5, // Max duration (in minutes) before an upload gets invalidated.
 ],

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants