HEX
Server: nginx/1.18.0
System: Linux test-ipsremont 5.4.0-214-generic #234-Ubuntu SMP Fri Mar 14 23:50:27 UTC 2025 x86_64
User: ips (1000)
PHP: 8.0.30
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/ipsremont-demo/storage/framework/views/cd4ca8316681bdf65e952b0f40af14257a9c6668.php
<?php $attributes = $attributes->exceptProps([
'label',
'name',
'route',
'routeId',
'required'=>false,
'error',
'acceptedFiles' => 'csv',
'maxFiles' => 1,
'size' => 10,
'dropZoneDesc' => null,
]); ?>
<?php foreach (array_filter(([
'label',
'name',
'route',
'routeId',
'required'=>false,
'error',
'acceptedFiles' => 'csv',
'maxFiles' => 1,
'size' => 10,
'dropZoneDesc' => null,
]), 'is_string', ARRAY_FILTER_USE_KEY) as $__key => $__value) {
    $$__key = $$__key ?? $__value;
} ?>
<?php $__defined_vars = get_defined_vars(); ?>
<?php foreach ($attributes as $__key => $__value) {
    if (array_key_exists($__key, $__defined_vars)) unset($$__key);
} ?>
<?php unset($__defined_vars); ?>

<span id="_fileInputs"></span>

<div class="form-group">
    <label><?php if(isset($label) && $label): ?>
            <?php echo app('translator')->get($label); ?>
        <?php else: ?>
            <?php echo app('translator')->get('services.labelFieldFileUpload'); ?>
        <?php endif; ?></label>
    <div class="input-group">
        <div class="dropzone dropzone-default dropzone-success" id="upload_file">
            <div class="dropzone-msg dz-message needsclick">
                <h3 class="dropzone-msg-title"><?php echo app('translator')->get('services.textFieldFileUpload'); ?></h3>
                <?php if(!empty($acceptedFiles)): ?>
                    <span class="dropzone-msg-desc"><?php echo app('translator')->get('services.onlyFile'); ?> <?php echo e($acceptedFiles); ?></span>
                <?php endif; ?>
            </div>
        </div>
    </div>
    <?php if($error): ?>
        <div class="invalid-feedback"><?php echo e($error); ?></div>
    <?php endif; ?>
</div>


<?php $__env->startSection('js-script'); ?>
    <script>
        var KTDropzoneDemo = (function (x) {
            // Private functions
            var demo1 = function (x) {
                // file type validation
                $('#upload_file').dropzone({
                    url: "<?php echo e(empty($routeId) ? route($route) : route($route, $routeId)); ?>", // Set the url for your upload script location
                    paramName: "file", // The name that will be used to transfer the file
                    maxFiles: <?php echo e($maxFiles); ?>,
                    maxFilesize: <?php echo e($size); ?>, // MB
                    addRemoveLinks: true,
                    <?php if(!empty($acceptedFiles)): ?>
                    acceptedFiles: ".<?php echo e($acceptedFiles); ?>",
                    <?php endif; ?>
                    headers: {'X-CSRF-TOKEN': "<?php echo e(csrf_token()); ?>"},
                    success: function (file, response) {
                        if (response.success) {
                            let input = document.createElement('input');
                            input.setAttribute('value', response.success);
                            input.setAttribute('name', 'filePath[]');
                            input.setAttribute('type', 'hidden');
                            $('#_fileInputs').append(input)
                        }
                    },
                    error: function (file, response) {
                        if (!Math.round10) {
                            Math.round10 = function (value, exp) {
                                return decimalAdjust('round', value, exp);
                            };
                        }

                        if (Math.round10(file.size / 1024 / 1024, -1) >= <?php echo e($size); ?>)
                            KTBootstrapNotifyDemo.init({'message': "<?php echo app('translator')->get('admins.fileTooLarge'); ?> <?php echo e('(' . $size . 'MB)'); ?>&nbsp;&nbsp;"}, 'danger', true);
                        else
                            KTBootstrapNotifyDemo.init({'message': "<?php echo app('translator')->get('admins.wrongFileType'); ?>"}, 'danger', true);
                        return false;
                    }
                });
            };
            return {
                // public functions
                init: function () {
                    demo1();
                }
            }
        })();
        KTUtil.ready(function () {
            KTDropzoneDemo.init();
        });

        function decimalAdjust(type, value, exp) {
            if (typeof exp === 'undefined' || +exp === 0) {
                return Math[type](value);
            }
            value = +value;
            exp = +exp;
            if (isNaN(value) || !(typeof exp === 'number' && exp % 1 === 0)) {
                return NaN;
            }
            value = value.toString().split('e');
            value = Math[type](+(value[0] + 'e' + (value[1] ? (+value[1] - exp) : -exp)));
            value = value.toString().split('e');
            return +(value[0] + 'e' + (value[1] ? (+value[1] + exp) : exp));
        }
    </script>
<?php $__env->stopSection(); ?>

<?php echo e($slot); ?>

<?php /**PATH /var/www/ipsremont-demo/resources/views/components/fields/upload.blade.php ENDPATH**/ ?>