wot-design-uni
wot-design-uni copied to clipboard
upload 能否增加一个对于file 处理的一个函数,比如自定义压缩这个file的处理,或者提供一个自定义request,我们可以自定义上传方法。
这个功能解决了什么问题?
自定义压缩file文件
你期望的 API 是什么样子的?
<wd-upload action="https://ftf.jd.com/api/uploadImg" :file-compress="fileCompress"></wd-upload>
function fileCompress({file,resolve}){
// 执行压缩操作,改变file
.......
resolve(newFile)
}
是小程序平台吗,目前没有了解到有什么方法可以在chooseImage和uoloadFile方法之间做一个压缩的。
---原始邮件--- 发件人: @.> 发送时间: 2024年4月25日(周四) 上午10:30 收件人: @.>; 抄送: @.***>; 主题: [Moonofweisheng/wot-design-uni] upload 能否增加一个对于file 处理的一个函数,比如自定义压缩这个file的处理,或者提供一个自定义request,我们可以自定义上传方法。 (Issue #261)
这个功能解决了什么问题?
自定义压缩file文件
你期望的 API 是什么样子的?
<wd-upload action="https://ftf.jd.com/api/uploadImg" :file-compress="fileCompress"></wd-upload>
function fileCompress({file,resolve}){ // 执行压缩操作,改变file ....... resolve(newFile) }
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: @.***>
是小程序平台吗,目前没有了解到有什么方法可以在chooseImage和uoloadFile方法之间做一个压缩的。 … ---原始邮件--- 发件人: @.> 发送时间: 2024年4月25日(周四) 上午10:30 收件人: @.>; 抄送: @.>; 主题: [Moonofweisheng/wot-design-uni] upload 能否增加一个对于file 处理的一个函数,比如自定义压缩这个file的处理,或者提供一个自定义request,我们可以自定义上传方法。 (Issue #261) 这个功能解决了什么问题? 自定义压缩file文件 你期望的 API 是什么样子的? <wd-upload action="https://ftf.jd.com/api/uploadImg" :file-compress="fileCompress"></wd-upload> function fileCompress({file,resolve}){ // 执行压缩操作,改变file ....... resolve(newFile) } — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.>
是小程序端,现在是通过canvas尺寸改变来压缩的。
是小程序平台吗,目前没有了解到有什么方法可以在chooseImage和uoloadFile方法之间做一个压缩的。 … ---原始邮件--- 发件人: @.> 发送时间: 2024年4月25日(周四) 上午10:30 收件人: @.>; 抄送: @.>; 主题: [Moonofweisheng/wot-design-uni] upload 能否增加一个对于file 处理的一个函数,比如自定义压缩这个file的处理,或者提供一个自定义request,我们可以自定义上传方法。 (Issue #261) 这个功能解决了什么问题? 自定义压缩file文件 你期望的 API 是什么样子的? <wd-upload action="https://ftf.jd.com/api/uploadImg" :file-compress="fileCompress"></wd-upload> function fileCompress({file,resolve}){ // 执行压缩操作,改变file ....... resolve(newFile) } — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.>
主要就是想是否可以提供一个可以操作这个file的一个函数。
那试试在before-upload做个处理呢。
---原始邮件--- 发件人: @.> 发送时间: 2024年4月25日(周四) 上午10:47 收件人: @.>; 抄送: @.@.>; 主题: Re: [Moonofweisheng/wot-design-uni] upload 能否增加一个对于file 处理的一个函数,比如自定义压缩这个file的处理,或者提供一个自定义request,我们可以自定义上传方法。 (Issue #261)
是小程序平台吗,目前没有了解到有什么方法可以在chooseImage和uoloadFile方法之间做一个压缩的。 … ---原始邮件--- 发件人: @.> 发送时间: 2024年4月25日(周四) 上午10:30 收件人: @.>; 抄送: @.>; 主题: [Moonofweisheng/wot-design-uni] upload 能否增加一个对于file 处理的一个函数,比如自定义压缩这个file的处理,或者提供一个自定义request,我们可以自定义上传方法。 (Issue #261) 这个功能解决了什么问题? 自定义压缩file文件 你期望的 API 是什么样子的? <wd-upload action="https://ftf.jd.com/api/uploadImg" :file-compress="fileCompress"></wd-upload> function fileCompress({file,resolve}){ // 执行压缩操作,改变file ....... resolve(newFile) } — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.>
是小程序端,现在是通过canvas尺寸改变来压缩的。
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
那试试在before-upload做个处理呢。 … ---原始邮件--- 发件人: @.> 发送时间: 2024年4月25日(周四) 上午10:47 收件人: @.>; 抄送: @.@.>; 主题: Re: [Moonofweisheng/wot-design-uni] upload 能否增加一个对于file 处理的一个函数,比如自定义压缩这个file的处理,或者提供一个自定义request,我们可以自定义上传方法。 (Issue #261) 是小程序平台吗,目前没有了解到有什么方法可以在chooseImage和uoloadFile方法之间做一个压缩的。 … ---原始邮件--- 发件人: @.> 发送时间: 2024年4月25日(周四) 上午10:30 收件人: @.>; 抄送: @.>; 主题: [Moonofweisheng/wot-design-uni] upload 能否增加一个对于file 处理的一个函数,比如自定义压缩这个file的处理,或者提供一个自定义request,我们可以自定义上传方法。 (Issue #261) 这个功能解决了什么问题? 自定义压缩file文件 你期望的 API 是什么样子的? <wd-upload action="https://ftf.jd.com/api/uploadImg" :file-compress="fileCompress"></wd-upload> function fileCompress({file,resolve}){ // 执行压缩操作,改变file ....... resolve(newFile) } — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.> 是小程序端,现在是通过canvas尺寸改变来压缩的。 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
是的,我觉得在beforeUpload最合适,可是目前我看beforeUpload之resolve一个boolean值,并没有可以操作改变file的。
beforeUpload({
files,
fileList: uploadFiles.value,
resolve: (isPass: boolean) => {
isPass && mapFiles(files)
}
})
那试试在before-upload做个处理呢。 … ---原始邮件--- 发件人: @.> 发送时间: 2024年4月25日(周四) 上午10:47 收件人: @.>; 抄送: @.@.>; 主题: Re: [Moonofweisheng/wot-design-uni] upload 能否增加一个对于file 处理的一个函数,比如自定义压缩这个file的处理,或者提供一个自定义request,我们可以自定义上传方法。 (Issue #261) 是小程序平台吗,目前没有了解到有什么方法可以在chooseImage和uoloadFile方法之间做一个压缩的。 … ---原始邮件--- 发件人: @.> 发送时间: 2024年4月25日(周四) 上午10:30 收件人: @.>; 抄送: @.>; 主题: [Moonofweisheng/wot-design-uni] upload 能否增加一个对于file 处理的一个函数,比如自定义压缩这个file的处理,或者提供一个自定义request,我们可以自定义上传方法。 (Issue #261) 这个功能解决了什么问题? 自定义压缩file文件 你期望的 API 是什么样子的? <wd-upload action="https://ftf.jd.com/api/uploadImg" :file-compress="fileCompress"></wd-upload> function fileCompress({file,resolve}){ // 执行压缩操作,改变file ....... resolve(newFile) } — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.> 是小程序端,现在是通过canvas尺寸改变来压缩的。 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
所以,是否可以考虑在beforeUpload中resolve,多一个额外file的参数。
OK,那这个可以提供。
---原始邮件--- 发件人: @.> 发送时间: 2024年4月25日(周四) 上午10:50 收件人: @.>; 抄送: @.@.>; 主题: Re: [Moonofweisheng/wot-design-uni] upload 能否增加一个对于file 处理的一个函数,比如自定义压缩这个file的处理,或者提供一个自定义request,我们可以自定义上传方法。 (Issue #261)
那试试在before-upload做个处理呢。 … ---原始邮件--- 发件人: @.> 发送时间: 2024年4月25日(周四) 上午10:47 收件人: @.>; 抄送: @.@.>; 主题: Re: [Moonofweisheng/wot-design-uni] upload 能否增加一个对于file 处理的一个函数,比如自定义压缩这个file的处理,或者提供一个自定义request,我们可以自定义上传方法。 (Issue #261) 是小程序平台吗,目前没有了解到有什么方法可以在chooseImage和uoloadFile方法之间做一个压缩的。 … ---原始邮件--- 发件人: @.> 发送时间: 2024年4月25日(周四) 上午10:30 收件人: @.>; 抄送: @.>; 主题: [Moonofweisheng/wot-design-uni] upload 能否增加一个对于file 处理的一个函数,比如自定义压缩这个file的处理,或者提供一个自定义request,我们可以自定义上传方法。 (Issue #261) 这个功能解决了什么问题? 自定义压缩file文件 你期望的 API 是什么样子的? <wd-upload action="https://ftf.jd.com/api/uploadImg" :file-compress="fileCompress"></wd-upload> function fileCompress({file,resolve}){ // 执行压缩操作,改变file ....... resolve(newFile) } — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.> 是小程序端,现在是通过canvas尺寸改变来压缩的。 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
是的,我觉得在beforeUpload最合适,可是目前我看beforeUpload之resolve一个boolean值,并没有可以操作改变file的。
beforeUpload({ files, fileList: uploadFiles.value, resolve: (isPass: boolean) => { isPass && mapFiles(files) } })
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: @.***>
OK,那这个可以提供。 … ---原始邮件--- 发件人: @.> 发送时间: 2024年4月25日(周四) 上午10:50 收件人: @.>; 抄送: @.@.>; 主题: Re: [Moonofweisheng/wot-design-uni] upload 能否增加一个对于file 处理的一个函数,比如自定义压缩这个file的处理,或者提供一个自定义request,我们可以自定义上传方法。 (Issue #261) 那试试在before-upload做个处理呢。 … ---原始邮件--- 发件人: @.> 发送时间: 2024年4月25日(周四) 上午10:47 收件人: @.>; 抄送: @.@.>; 主题: Re: [Moonofweisheng/wot-design-uni] upload 能否增加一个对于file 处理的一个函数,比如自定义压缩这个file的处理,或者提供一个自定义request,我们可以自定义上传方法。 (Issue #261) 是小程序平台吗,目前没有了解到有什么方法可以在chooseImage和uoloadFile方法之间做一个压缩的。 … ---原始邮件--- 发件人: @.> 发送时间: 2024年4月25日(周四) 上午10:30 收件人: @.>; 抄送: @.>; 主题: [Moonofweisheng/wot-design-uni] upload 能否增加一个对于file 处理的一个函数,比如自定义压缩这个file的处理,或者提供一个自定义request,我们可以自定义上传方法。 (Issue #261) 这个功能解决了什么问题? 自定义压缩file文件 你期望的 API 是什么样子的? <wd-upload action="https://ftf.jd.com/api/uploadImg" :file-compress="fileCompress"></wd-upload> function fileCompress({file,resolve}){ // 执行压缩操作,改变file ....... resolve(newFile) } — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.> 是小程序端,现在是通过canvas尺寸改变来压缩的。 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.> 是的,我觉得在beforeUpload最合适,可是目前我看beforeUpload之resolve一个boolean值,并没有可以操作改变file的。 beforeUpload({ files, fileList: uploadFiles.value, resolve: (isPass: boolean) => { isPass && mapFiles(files) } }) — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.>
感谢!
此 issue 已被自动锁定,因为关闭后没有任何近期活动。如果有相关 bug,请重新创建一个新 issue。