Flutter应用将图片上传到Firebase存储与Shopify应用对应-图片。媒体处理失败

问题描述 投票:1回答:1

我试图从一个网址添加带有照片的产品,我得到一个媒体处理错误。照片在其他地方都可以使用,但似乎没有被Shopify处理。

enter image description here

我也试过以base64文件上传,并在这里验证了base64文件没有坏:https:/codebeautify.orgbase64-to-image-converter。

这是我正在测试的图片。

base64

jpeg

我使用的代码来上传图片。

// upload compressed photo
            var compressedJpeg = await FlutterImageCompress.compressWithList(
              item.photoByteData.buffer.asUint8List(),
              format: CompressFormat.jpeg,
            );
            uploadTask = photoStorageReference.putData(
              Uint8List.fromList(compressedJpeg),
              StorageMetadata(contentType: 'image/jpeg'),
            );
            await uploadTask.onComplete;

// upload base64 image
            final base64Path =
                join((await getTemporaryDirectory()).path, 'base64_original');
            File base64File = File(base64Path);
            base64File.writeAsStringSync(base64Encode(compressedJpeg));
            uploadTask = base64StorageReference.putFile(
              base64File,
              StorageMetadata(contentType: 'image/jpeg'),
            );
            await uploadTask.onComplete;

有人遇到过这个问题吗?

firebase flutter shopify firebase-storage shopify-app
1个回答
0
投票

我找shopify支持聊天,url中的查询字符串不支持。

© www.soinside.com 2019 - 2024. All rights reserved.