0

我有一个用 laravel 5.2 框架、bootstrap 编写的网页,我的目的是将其用作移动网页,目前该页面在台式设备笔记本电脑或任何 IOS(苹果设备)上运行良好。问题是当我尝试要通过 android 设备访问该页面,我只能查看填写表格但无法上传图片,因为验证的警卫会抛出图片未上传的错误。换句话说,我的验证认为我没有上传任何图片,但我有所以这是代码,并且还提供了指向实际页面的链接,您可以在其中看到有问题的页面任何帮助赞赏链接及其背后的代码

if ( isset($_POST['submit'])) 
        {
                $check = getimagesize($_FILES['pic']['tmp_name']);
                if($check !== false) 
                {

                    $uploadOk = 1;
                    if (move_uploaded_file($_FILES['pic']['tmp_name'], $target_file)) 
                        {


                            $spotCheckImage = new SpotCheckImagePath();
                                    $spotCheckImage->imgname =  $new_file_name;
                                    $spotCheckImage->imagepath = $target_file;
                                    $spotCheckImage->spotCheckComment()->associate($spotCheckComment);
                                    $spotCheckImage->save();

                            Session::flash('success', 'The file '. basename( $_FILES['pic']['name']). 'has been uploaded.'); 
                            return Redirect::to('testform');

                        } else 
                            {

                                 Session::flash('error',  'Sorry, there was an error uploading your file.');
                                 return Redirect::to('testform');

                            }
                } 
                else 
                {

                    $uploadOk = 0;
                    Session::flash('error',  'File is not an image.');
                    return Redirect::to('testform');
                }
        }
4

0 回答 0