Cambio de multipart Axios
This commit is contained in:
@@ -72,10 +72,18 @@
|
||||
wire:model.live="photo"
|
||||
x-ref="photo"
|
||||
x-on:change="
|
||||
photoName = $refs.photo.files[0].name;
|
||||
const file = $refs.photo.files[0];
|
||||
if (!file) return;
|
||||
const maxBytes = 50 * 1024 * 1024;
|
||||
if (file.size > maxBytes) {
|
||||
$refs.photo.value = '';
|
||||
alert('La foto supera el límite de 50 MB. Por favor elige una imagen más pequeña.');
|
||||
return;
|
||||
}
|
||||
photoName = file.name;
|
||||
const reader = new FileReader();
|
||||
reader.onload = (e) => { photoPreview = e.target.result; };
|
||||
reader.readAsDataURL($refs.photo.files[0]);
|
||||
reader.readAsDataURL(file);
|
||||
" />
|
||||
|
||||
<label class="form-label fw-bold mb-3">Foto de perfil</label>
|
||||
|
||||
Reference in New Issue
Block a user