Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于wx.saveFile #2

Open
grtreexyz opened this issue Nov 16, 2016 · 7 comments
Open

关于wx.saveFile #2

grtreexyz opened this issue Nov 16, 2016 · 7 comments

Comments

@grtreexyz
Copy link

我今天弄小程序,用wx.saveFile在手机上保存了一个图片提示保存成功(iphone6),但手机相册里看不到,请问你那里保存到本地是怎么做的,可以帮帮我吗?

@18Yi
Copy link

18Yi commented Dec 7, 2016

@grtreexyz 请问你的wx.saveFile在手机上保存的时候,图片的后缀是正确的吗?

@grtreexyz
Copy link
Author

grtreexyz commented Dec 8, 2016

wx.canvasToTempFilePath({
    canvasId: 'target',
    success: function(res) {
        wx.saveFile({
            tempFilePath: res.tempFilePath,
            success: function(res) {
                console.log('saved::' + res.savedFilePath);
            },
            complete: function(e) {
                console.log(e.errMsg);
            }
        });
    },
    complete: function(e) {
        console.log(e.errMsg)
    },
});

返回 saved::wxfile://store_e?????????????????????????????????.jpg

@18Yi
Copy link

18Yi commented Dec 8, 2016

@grtreexyz 好吧,我是通过wx.downloadFile然后wx.saveFile保存的,然后真机上获取不到图片正确的后缀,感觉可以试试你的方法,先把图画在画布上,再保存应该可以得到正确的后缀。谢谢!

@cristaltina
Copy link

@grtreexyz 请问你的问题解决了嘛?我也能成功保存到本地,但在相册中看不到

@xdkaka
Copy link

xdkaka commented Apr 17, 2017

搞了半天找到官方文档:不支持啊
https://developers.weixin.qq.com/blogdetail?action=get_post_info&lang=zh_CN&token=&docid=2fcdb7794d48c59f7624f53e94d0ae22
Q:微信小程序现在支持将图片保存到相册吗?
A:目前不支持保存图片到相册。

@18Yi
Copy link

18Yi commented Apr 19, 2017

可以做个图片预览(全屏状态),让用户长按图片保存到相册 @cristaltina @xdkaka @puterjam

@VincentCope
Copy link

@18Yi 目前只能通过让用户长按保存图片这一个方法吧?还有一键复制文本的功能也不好实现...必须要用户选择,局限性还是很大啊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants