var storageRef = firebase.storage().ref('images');
let uuid = uuidv1();
var uploadTask = storageRef.child(`${uuid}`).putString(imageUrl, 'base64', {contentType:'image/jpg'});
代码将生成一个基于时间的UUID作为文件名,imageUrl是用户上传的base64图像文件。我使用react-native-photo-upload编写上传函数。然后在firebase中,我收到了一个
我使用asp.net核心web启动了一个带有spa模板的项目,并希望将图像上传到服务器(例如,用户化身),然后在客户端应用程序中显示图像。
上传没有任何问题,但我的问题是在哪里保存上传的图像?
ConfigureServices中的静态文件在startup.cs中有位置
// In production, the React files will be served from this directory
services.AddSpaStaticFiles(configuration =>
{
configuration.RootPath = "ClientApp/bu
我使用formdata在react-native中通过axios发送图像和内容。The response I want to send is something like this。如果数据库中已经存在两张图片,我将在索引2处插入图像,将第0个和第1个索引留空。类似地,如果我必须更新我的第二个图像,我会上传并推送第一个索引上的图像。 当我在postman上测试我的api时,图像被插入到db中。Here is a screenshot of postman response 现在,当我通过react native发送我的formdata时,它不会显示在db中,尽管图像被保存到了我的上传文件夹中