Я использую объектные данные для сохранения ввода формы, изображений, видео в базе данных. Это не работает для пользователей Iphone - PullRequest
0 голосов
/ 12 мая 2018

Мой код для ввода формы.

 validateForm: function (scope) {
        this.$validator.validateAll(scope).then(result => {
            if (result) {
                this.newProductData.brand = this.step2.brand;
                this.newProductData.condition = this.step3.condition;
                this.newProductData.desc = this.step2.desc;
                this.newProductData.name = this.step2.name;
                this.newProductData.qty = this.step2.qty;
                this.newProductData.height = this.step3.height;
                this.newProductData.width = this.step3.width;
                this.newProductData.depth = this.step3.depth;
                this.newProductData.weight = this.step3.weight;
                this.newProductData.images = this.images;

                this.loader = true;
                alert('before formdata');
                let formData = objectToFormData(this.newProductData);
               d);
                formData.append('video',this.formData.get('video'));

                axios.post('/user/dashboard/products/new',formData, {emulateJSON: true}).then(response=>{
                    if(response.data.status === 'success'){
                        //this.addVideoImage(response.data.product_id);
                        Vue.toasted.success(response.data.message, {
                            position: 'top-center',
                            duration: 3000
                        });
                        setTimeout(function(){
                            window.location.href = '/user/dashboard/products';
                        }, 1000);
                    }else{
                        this.loader = false;
                        Vue.toasted.error('Something went wrong!', {
                            position: 'top-center',
                            duration: 3000
                        })
                    }
                });

После принятия formdata в качестве объекта при попытке добавить видеофайл в объект formDate он не работает.

Проблема только для пользователей Iphone.

Любые предложения или любая другая библиотека будут очень полезны. Спасибо

...