Level 16
Replace mimetypes with mimes:zip
1 like
Hi everyone. I have a rare situation. I am building a Laravel - Vue application on Ubuntu20.04. I upload an application/zip file using axios through following method:
<script>
import axios from "axios"
export default {
name:'Application',
methods:{
upload_file(event){
const file = event.target.files[0];
var formdata = new FormData()
formdata.set('file', file)
axios.post('upload', formdata).then((res)=>{
res = res.data;
})
}
}
}
</script>
public function upload(Request $req){
$validator = Validator::make($req->all(), [
'file'=>['required', 'mimetypes:application/zip'],
]);
if($validator->fails()){
return $validator->errors();
}
return 'okay';
}
Now the weird part is that I can upload application/zip file easily and Laravel grants mimetypes:application/zip rule. But when I tried it on multiple windows OSs, Laravel rejects request like "select application/zip file"!! I am uploading the same application/zip file on windows and linux but windows not working! Can anybody help? Thank you in advance
Please or to participate in this conversation.