Laravel-medialibrary: File extensions is not correct when uploading from base64

Created on 16 Dec 2017  路  1Comment  路  Source: spatie/laravel-medialibrary

When uploading a file from base64 using method addMediaFromBase64, the final file extension is .tmp always.

Here is the code i use to upload the file.

$value = "data:text/plain;base64,SGVyZSBpcyBhIHRlc3QgdGV4dC4=";
$user->addMediaFromBase64($value)->toMediaLibrary('licences');

The final file name is: medCAF3.tmp.

Don't must addMediaFromBase64 method add file extension automatically to the file nam?

>All comments

You can use usingFileName to set the name of file.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mokhosh picture mokhosh  路  3Comments

Krato picture Krato  路  4Comments

denitsa-md picture denitsa-md  路  3Comments

swash13 picture swash13  路  3Comments

jam1e picture jam1e  路  3Comments