enter code hereI need to upload all the formats to the image from jpg, jpeg, so I can upload one image format, which is png, can help me thank you
I need to upload all the formats to the image from jpg, jpeg, so I can upload one image format, which is png, can help me
<script type="text/javascript">
var var15671147171873255749ble = [];
@if(isset($product) && $product->hasMedia('image'))
@forEach($product->getMedia('image') as $media)
var15671147171873255749ble.push({
name: "{!! $media->name !!}",
size: "{!! $media->size !!}",
type: "{!! $media->mime_type !!}",
uuid: "{!! $media->getCustomProperty('uuid'); !!}",
thumb: "{!! $media->getUrl('thumb'); !!}",
collection_name: "{!! $media->collection_name !!}"
});
@endforeach
@endif
var dz_var15671147171873255749ble = $(".dropzone.image").dropzone({
url: "{!!url('uploads/store')!!}",
addRemoveLinks: true,
maxFiles: 5 - var15671147171873255749ble.length,
init: function () {
@if(isset($product) && $product->hasMedia('image'))
var15671147171873255749ble.forEach(media => {
dzInit(this, media, media.thumb);
});
@endif
},
accept: function (file, done) {
dzAccept(file, done, this.element, "{!!config('medialibrary.icons_folder')!!}");
},
sending: function (file, xhr, formData) {
dzSendingMultiple(this, file, formData, '{!! csrf_token() !!}');
},
complete: function (file) {
dzCompleteMultiple(this, file);
dz_var15671147171873255749ble[0].mockFile = file;
},
removedfile: function (file) {
//this.removeFile(file);
dzRemoveFileMultiple(
file, var15671147171873255749ble, '{!! url("products/remove-media") !!}',
'image', '{!! isset($product) ? $product->id : 0 !!}', '{!! url("uplaods/clear") !!}', '{!! csrf_token() !!}'
);
}
});
dz_var15671147171873255749ble[0].mockFile = var15671147171873255749ble;
dropzoneFields['image'] = dz_var15671147171873255749ble;
</script>
thank you
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire