Comments (16)
flutter我试过, 使用 dio 可以很容易地上传到oss, 封装的部分代码如下:
oss(File file) async {
var ext = file.path.split('.').last;
var userId = (await Storage.get('userInfo'))['id'].toString();
var now = (new DateTime.now()).toString();
var uuid = new Uuid();
var filename = uuid.v5(Uuid.NAMESPACE_URL, now + userId);
// 签名
FormData data = new FormData.from({
'Filename': '文件名,随意',
'key' : "$uploadBaseUrl/$filename.$ext",
'policy': policyBase64,
'OSSAccessKeyId': accesskeyId,
'success_action_status' : '200', //让服务端返回200,不然,默认会返回204
'signature': signature,
'file': new UploadFileInfo(file, "imageFileName")
});
try {
Response response = await dio.post(ossPath, data: data);
var uploadPath = "$ossPath/$uploadBaseUrl/$filename.$ext";
print(response);
print("上传成功: $uploadPath");
return uploadPath;
} on DioError catch(e) {
print("上传失败: $e");
}
}
from aliyun-oss-react-native.
@jlcool 团队已经有小伙伴开始调研。
from aliyun-oss-react-native.
flutter 版本的sdk 出了吗
from aliyun-oss-react-native.
@Liangqianyong 出一整套的方案的话,成本太高,有个基于postobject的flutter sdk你可以参考下。https://github.com/luozhang002/postflutter-demo
此外网上也有第三方用户开发了一个 flutteross插件,也可以参考下。
https://github.com/jlcool/aliossflutter
from aliyun-oss-react-native.
@luozhang002 其实官方可以根据android和ios的官方sdk,出一个flutter插件就好了
from aliyun-oss-react-native.
官方什么时候出flutter插件库呀?大势所趋,阿里云能不能跟上时代的步伐呀
from aliyun-oss-react-native.
还是没有flutter库啊,https://github.com/jlcool/aliossflutter ,这个不够强壮,感觉作者并没有在生产环境中使用,不然也不会那么多bug。。。作者也好久没维护了。
from aliyun-oss-react-native.
@luozhang002 官方出一个吧,我都不会原生开发,插件不好维护
from aliyun-oss-react-native.
闲鱼团队不是一直在跟进flutter技术么?官方出一个应该不难啊
from aliyun-oss-react-native.
https://pub.dev/packages/aly_oss 这个是不是官方的?
from aliyun-oss-react-native.
@luozhang002 这么多人提需求,出个flutter sdk吧!
from aliyun-oss-react-native.
+1 求flutter版
from aliyun-oss-react-native.
+1 求flutter版
from aliyun-oss-react-native.
+1 求flutter版
from aliyun-oss-react-native.
+1 求flutter版
from aliyun-oss-react-native.
+1 求flutter版
from aliyun-oss-react-native.
Related Issues (20)
- 请问还会更新吗? HOT 3
- 在pod install的时候 Installing AliyunOSSiOS 一直卡在这边 HOT 2
- com.aliyun.oss.clientError Code=6 HOT 1
- AliyunOSS.asyncDownload 下载文件问题
- android studio下,加载aliyun-oss-react-native包报错
- 请问下这个问题如何解决?Unable to resolve host "xxx.aliyuncs.com": No address associated with hostname
- 调用initWithSecurityToken会卡住js线程吗?
- 安装OSS模块后app launch compile错误 HOT 6
- asyncUpload method can't find the file path HOT 3
- android Q没有适配,上传图片路径会出错 HOT 1
- Attempt to invoke virtual method 'void com.reactlibrary.AliyunUploadManager.asyncUpload(com.facebook.react.bridge.ReactContext, java.lang.String, java.lang.String, java.lang.String, com.facebook.react.bridge.ReadableMap, com.facebook.react.bridge.Promise)' on a null object reference HOT 2
- 模块3年没有更新,已经abandoned? HOT 1
- AliyunUploadManager.java uses unchecked or unsafe operations.
- 公告:这个SDK后面有时间准备重新搞起来了,大家有issue,有PR的欢迎可以提交 HOT 17
- 上传图像在Android emulator运行通畅但在安桌手机上stuck HOT 1
- 请为 Expo 创建一个 Config Plugin
- yarn ios 报错 HOT 5
- 这个项目还在维护嘛?还能使用嘛? HOT 1
- Could not GET 'https://oss.sonatype.org/content/repositories/snapshots/com/aliyun/dpa/oss-android-sdk/2.3.0-SNAPSHOT/maven-metadata.xml'. Received status code 502 from server: Bad Gateway HOT 2
- 在Android10以上,上传文件失败,原因已找到,请修复
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aliyun-oss-react-native.