Coder Social home page Coder Social logo

upload 能否增加一个对于file 处理的一个函数,比如自定义压缩这个file的处理,或者提供一个自定义request,我们可以自定义上传方法。 about wot-design-uni HOT 8 OPEN

BeginnerDone avatar BeginnerDone commented on May 30, 2024
upload 能否增加一个对于file 处理的一个函数,比如自定义压缩这个file的处理,或者提供一个自定义request,我们可以自定义上传方法。

from wot-design-uni.

Comments (8)

Moonofweisheng avatar Moonofweisheng commented on May 30, 2024

from wot-design-uni.

BeginnerDone avatar BeginnerDone commented on May 30, 2024

是小程序平台吗,目前没有了解到有什么方法可以在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尺寸改变来压缩的。

from wot-design-uni.

BeginnerDone avatar BeginnerDone commented on May 30, 2024

是小程序平台吗,目前没有了解到有什么方法可以在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的一个函数。

from wot-design-uni.

Moonofweisheng avatar Moonofweisheng commented on May 30, 2024

from wot-design-uni.

BeginnerDone avatar BeginnerDone commented on May 30, 2024

那试试在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)
            }
 })

from wot-design-uni.

BeginnerDone avatar BeginnerDone commented on May 30, 2024

那试试在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的参数。

from wot-design-uni.

Moonofweisheng avatar Moonofweisheng commented on May 30, 2024

from wot-design-uni.

BeginnerDone avatar BeginnerDone commented on May 30, 2024

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: @.>

感谢!

from wot-design-uni.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.