-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
feat: add file-transfer
plugin
#24
Comments
@robingenz there is this plugin https://github.com/AlwaysLoveme/capacitor-plugin-filedownload not sure if can help or contribute to it. |
Capacitor Filesystem will soon be able to download files and Http has been updated to handle FormData and files in FormData. |
This plugin will offer advanced features. That is why it is still on the roadmap, at least for now. |
Cool! Then I will add my "request" for an advanced-feature: progress event callback for each download instead/(additionally) of a listener on all request (like it is with the current implementation by Ionic-Team). Our use-case is a download-widget which downloads >1800 files in parallel in batches and I would like to have a proper kb/s and estimated time progress in it. Our current implementation works but it requires to cache the url and loaded bytes in a Set and other hacky stuff to make it work. |
My current implementation (Android is done, iOS & Web is pending) also uses a listener for all uploads/downloads, but instead of using |
Ah, great, that would work a little better if it is returned with each event. Just sharing my listener here for anyone looking for that: Http download listenerprivate createHttpListener() {
return Filesystem.addListener("progress", ({ url, bytes, contentLength }) => {
const progress = new DownloadProgress(
this.remaining,
this.bytesTotal,
this.bytesLoaded,
contentLength,
)
if (!url.includes("your-domain.")) {
// Files coming from other servers have no file size so we need to get that
// value during file download.
if (contentLength === 0) {
// Some servers do not respond with a content length.
this.event.downloadProgressChange.next(progress)
return
}
if (!this.previousBytes.has(url)) {
this.bytesTotal += contentLength
this.previousBytes.set(url, 0)
}
}
this.bytesLoaded += bytes - (this.previousBytes.get(url) || 0)
this.previousBytes.set(url, bytes)
this.event.downloadProgressChange.next(progress)
})
} |
Are there any infos when or in which version Upload/Download will be available? |
@SchneMa ETA is next month. |
Any news on this? |
I prioritized the development of another plugin for a sponsor (see capawesome-team/capacitor-firebase#434). Therefore, the development of this plugin has been postponed. |
Any news?, I want to upload large files (videos) with capacitor without Ionic and I read "The File Handling Guide for Capacitor" and here mentions that there are plugins to upload files directly to server but I have no idea what they are |
@lsolano2707 A few plugins are: But this plugin is not yet available. |
Is your feature request related to a problem? Please describe:
Currently there is no Capacitor 4 compatible plugin that can be used to upload and download files.
Describe the solution you'd like:
Create a plugin that allows you to upload and download files.
Describe alternatives you've considered:
Additional context:
Related to ionic-team/capacitor#5964
The text was updated successfully, but these errors were encountered: