当前痛点:一、文件批量上传,二、保持原文件名。求问大佬解题思路?

小程序 文章 2021-03-11 11:41 46 0 全屏看文

当前痛点:一、文件批量上传,二、保持原文件名。求问大佬解题思路?Current pain points: First, upload files in batches, and second, keep the original file names. Ask the boss for his problem-solving ideas?

当前痛点:一、文件批量上传,二、保持原文件名。求问大佬解题思路?

一个相册小程序的后台,使用了新内容管理CMS系统,非常棒。但就我自身的业务流程,还有两个痛点没找到解法。求问各位大佬指点指教!先谢了

一、文件批量上传问题。之前解决方案是直接在小程序里,用wx.chooseImage+wx.cloud.uploadFile实现,上传云存储。实现得很流畅,但单次最多九张。而且无法获取原文件名。然后尝试在CMS里实现。但操作页面一次只能选一张,得一张张的加,就差那么一点点。能一次全选,就完美了。不知有什么方法实现。

二、就是拿不到原文件的文件名问题。所有上传的文件,系统都是自动生成的临时地址,上传以后也是云文件 ID,小程序内展示没问题,但回头去找本地的源文件就麻烦了。所以如何拿到和保存原文件名的问题一直没有解决。求问大佬是否有实现方法或是思路?现在我有一个方向是,不用微信的云存储,而是用腾讯云的对象存储cos,这个是否对路?


现在一次拍摄都是几百张起,这么个选择和上传,太致命了。而且拍摄时用raw文件,转jpeg上传小程序跑业务流程。回头还是得用raw完成后续业务,线上线下业务现在只能用文件名来联系。这个问题和很要紧。求教求教,不甚感谢!


The background of a small photo album program, using the new content management CMS system, very good. But in terms of my own business process, there are still two pain points that have not been solved. Ask you guys advice! First of all, thank you for the problem of batch upload of files. Before the solution is directly in the small program, using the wx.chooseImage + wx.cloud.uploadFile Implementation, upload cloud storage. Very smooth implementation, but up to nine at a time. And cannot get the original file name. Then try to implement it in CMS. But the operation page can only choose one at a time, one by one plus, just a little bit worse. It's perfect to choose all at once. I don't know how to achieve it. 2、 Just can't get the file name of the original file. All the uploaded files, the system is automatically generated temporary address, upload after the cloud file ID, small program display no problem, but go back to the local source file trouble. So how to get and save the original file name has not been solved. Ask the boss if there is a way to achieve or ideas? Now I have a direction: instead of wechat cloud storage, I use Tencent cloud objects to store cos. Is this the right way? Now a shot is hundreds, such a choice and upload, too fatal. And when shooting with raw file, JPEG upload small program run business process. In the future, we still have to use raw to complete the follow-up business. Now the online and offline business can only be contacted by the file name. This is a very important issue. Thank you very much!

回答:

Eric:

https://docs.cloudbase.net/api-reference/managerode/storage.html#uploaddirectory

自己写个脚本通过上传文件夹批量上传上去,

George:嗯嗯,感谢,研究研究
George:感谢,我先研究研究
玩机小黄鸭:

可以尝试一下云开发api调用

George:谢谢,能具体点么?

-EOF-