Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

微信小程序上传文件到腾讯云v5;Wechat mini program upload file to tencent cos v5

License

NotificationsYou must be signed in to change notification settings

piscium2010/cos-wx-upload-file

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

微信小程序上传文件到腾讯云v5

Demo

demo

微信小程序仅支持https请求上传文件,所以我们选择了腾讯云作为文件服务器。此外腾讯云提供了配套小程序开发的SDK,方便微信上传文件时调用。

为了例子的简洁性,这里没有使用服务器鉴权,而采用了前端鉴权

前提

我们假设(哥们儿/妹子)你已经入门微信小程序开发

准备工作

注册腾讯云

COS对象存储控制台 创建存储桶,

填入存储桶名称等基本信息。为了方便测试,选择公有读私有写

为存储桶添加跨域访问规则(重要)

如果你不熟悉跨域访问设置,可参考以下配置

获取你的 Bucket(存储桶名称), Region(地域名称) 和访问域名

控制台密钥管理 获取你的 SecretId 和 SecretKey

登录微信公众平台 设置 --> 开发设置,将你刚才得到的访问域名填入服务器域名

至此,准备工作全部完成

运行项目

git clone https://github.com/piscium2010/cos-wx-upload-file.git

编辑cos-wx-upload-file\pages\index\config.js,替换你的 Bucket, Region, SecretId, SecretKey

运行小程序

写这篇教程就是因为微信的官网教程写得跟___一样,如同意请右上角点赞

羞耻广告位

designare-table: 企业级react table组件, IE11 下性能完胜Ant Design

迅速搭建React源码测试环境

About

微信小程序上传文件到腾讯云v5;Wechat mini program upload file to tencent cos v5

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp