我使用vue和codeigniter rest服务器构建了一个应用程序,我尝试通过邮递员上传文件,它工作正常,但是当我从前端尝试时,文件没有上传,文件夹权限已被允许,这是我的vue代码
data() {
return {
data: {
photo: // base64 data
}
}
}
关于方法
addMember(){
this.axios.post('member', this.data).then(res => {
console.log(res)
}).catch(err => {
console.log(err)
})
}
在后端
$filename = round(microtime(true)).'.png';
$config['file_name'] = $filename;
$config['upload_path'] = './storage/';
$config['allowed_types'] = '*';
$config['max_size'] = 50000;
$config['max_width'] = 50000;
$config['max_height'] = 50000;
$this->load->library('upload', $config);
$this->upload->do_upload('photo');
感谢您的答复