我使用 react-bootstrap 在 react 应用程序中创建了一个表单,我在其中使用以下命令选择要上传的文件FormControl:
<FormGroup>
<ControlLabel>Photos</ControlLabel>
<FormControl name="images[]" type="file" multiple onChange={this.handlePhotos}/>
</FormGroup>
Run Code Online (Sandbox Code Playgroud)
我的 handlePhotos 函数在哪里:
handlePhotos(event) {
event.preventDefault();
let files = event.target.files;
if(files && files.length > 0)
{
this.setState({device_photos: files});
}
else
console.log("no files selected");
}
}
Run Code Online (Sandbox Code Playgroud)
但是当我使用 axios 向我的后端发出 post 请求时,照片参数似乎为空。有人可以建议如何获取文件并将它们设置在状态变量中以通过发布请求上传吗?
我正在尝试为ARM交叉编译linphone。我使用配置
./configure --host=arm-linux-gnueabi --with-gnu-ld --disable-static --disable-glib --with-osip=/home/user/linphone_wheezy --with-readline=/home/user/linphone_wheezy SPEEX_CFLAGS="-I/home/user/linphone_wheezy/include" SPEEX_LIBS="-L/home/user/linphone_wheezy/lib -lspeex" SPEEXDSP_CFLAGS="-I/home/user/linphone_wheezy/include" SPEEXDSP_LIBS="-L/home/user/linphone_wheezy/lib -lspeexdsp" CC=$CROSS_TOOLCHAIN/bin/arm-linux-gnueabi-gcc --disable-video --enable-gtk_ui=no
Run Code Online (Sandbox Code Playgroud)
配置脚本成功执行,但是当我运行make时,链接时出现以下错误:
libtool: link: unable to infer tagged configuration
libtool: link: specify a tag with `--tag'
Run Code Online (Sandbox Code Playgroud)
我尝试添加
--tag=CC and --tag=LD
Run Code Online (Sandbox Code Playgroud)
但没有成功。有人可以给这个错误一些提示吗?