Skip to content

Commit 3d552fe

Browse files
chore: Merge branch 'main' into development
2 parents c0ae62f + 88f5b57 commit 3d552fe

File tree

18 files changed

+123
-79
lines changed

18 files changed

+123
-79
lines changed

.github/workflows/release_plugin.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ permissions:
1212
contents: write
1313
issues: write
1414
deployments: write
15+
id-token: write # to enable use of OIDC for npm provenance
1516

1617
jobs:
1718
setup:

CHANGELOG.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,28 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6-
# [1.0.0](https://github.com/ionic-team/capacitor-file-transfer/tree/v1.0.0) (2025-05-26)
6+
## [1.0.3](https://github.com/ionic-team/capacitor-file-transfer/compare/v1.0.2...v1.0.3) (2025-08-07)
7+
8+
9+
### Bug Fixes
10+
11+
* **android:** upload with content URIs ([#14](https://github.com/ionic-team/capacitor-file-transfer/issues/14)) ([49f330f](https://github.com/ionic-team/capacitor-file-transfer/commit/49f330fa09f2d78fb453195a13e77aa1d1a81c32))
12+
13+
14+
## [1.0.2](https://github.com/ionic-team/capacitor-file-transfer/compare/1.0.1...v1.0.2) (2025-07-31)
15+
16+
### Fixes
17+
18+
- **android**: normalize path before running public directory check ([#8](https://github.com/ionic-team/capacitor-file-transfer/pull/8))
19+
- **ios**: Use capacitor-swift-pm from 7.0.0 instead of specific version ([#12](https://github.com/ionic-team/capacitor-file-transfer/pull/12))
20+
21+
## [1.0.1](https://github.com/ionic-team/capacitor-file-transfer/compare/v1.0.0...1.0.1) (2025-06-30)
22+
23+
### Fixes
24+
25+
- Set dependency on @capacitor/synapse to 1.0.3 to fix ssr environments
26+
27+
## [1.0.0](https://github.com/ionic-team/capacitor-file-transfer/tree/v1.0.0) (2025-05-26)
728

829
### Features
930

README.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,31 @@
1-
# capacitor-file-transfer
2-
File Transfer plugin for Capacitor ⚡️
1+
<div align="center">
2+
<img src=".github/assets/logo.png" alt="Logo" width="auto" height="100">
3+
4+
<h3 align="center"> @capacitor/file-transfer</h3>
5+
6+
<p align="center">
7+
The FileTransfer API provides mechanisms for downloading and uploading files.
8+
<br />
9+
<a href="https://github.com/ionic-team/cordova-outsystems-file-transfer">🔌 Cordova Plugin</a>
10+
·
11+
<a href="https://github.com/ionic-team/ion-android-filetransfer">🤖 Android Library</a>
12+
·
13+
<a href="https://github.com/ionic-team/ion-ios-filetransfer">🍏 iOS Library</a>
14+
</p>
15+
<p align="center">
16+
<a href="https://github.com/ionic-team/capacitor-file-transfer/issues/new?labels=bug&template=bug-report.md">🐛 Report Bug</a>
17+
·
18+
<a href="https://github.com/ionic-team/capacitor-file-transfer/issues/new?labels=enhancement&template=feature-request.md"> 💡 Request Feature</a>
19+
</p>
20+
</div>
21+
22+
## Install
23+
24+
```bash
25+
npm install @capacitor/file-transfer
26+
npx cap sync
27+
```
28+
29+
## Documentation
30+
31+
Refer to [this page](packages/capacitor-plugin/README.md).

packages/capacitor-plugin/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ let package = Package(
1010
targets: ["FileTransferPlugin"])
1111
],
1212
dependencies: [
13-
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", exact: "7.1.0")
13+
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "7.0.0")
1414
],
1515
targets: [
1616
.binaryTarget(

packages/capacitor-plugin/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ repositories {
5858
dependencies {
5959
implementation fileTree(dir: 'libs', include: ['*.aar', '*.jar'])
6060
implementation project(':capacitor-android')
61-
implementation "io.ionic.libs:ionfiletransfer-android:1.0.0"
61+
implementation "io.ionic.libs:ionfiletransfer-android:1.0.1"
6262
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
6363

6464
testImplementation "junit:junit:$junitVersion"

packages/capacitor-plugin/android/src/main/java/com/capacitorjs/plugins/filetransfer/FileTransferPlugin.kt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import kotlinx.coroutines.cancel
2525
import kotlinx.coroutines.flow.catch
2626
import kotlinx.coroutines.flow.launchIn
2727
import kotlinx.coroutines.flow.onEach
28+
import androidx.core.net.toUri
2829

2930
@CapacitorPlugin(
3031
name = "FileTransfer",
@@ -323,19 +324,22 @@ class FileTransferPlugin : Plugin() {
323324
* @return Returns true if the file path is in a public directory
324325
*/
325326
private fun isPublicDirectory(filePath: String): Boolean {
327+
// Normalize to path if it is a uri path
328+
val normalizedPath = filePath.toUri().path ?: filePath
329+
326330
// Check if the path is in external storage
327331
val externalStoragePath = Environment.getExternalStorageDirectory().absolutePath
328-
332+
329333
// Get package directory paths
330334
val appPrivatePaths = listOf(
331335
context.filesDir.absolutePath,
332336
context.cacheDir.absolutePath,
333337
context.getExternalFilesDir(null)?.absolutePath,
334338
context.externalCacheDir?.absolutePath
335339
)
336-
340+
337341
// Check if path is in external storage but not in app-specific directories
338-
return filePath.startsWith(externalStoragePath) &&
339-
appPrivatePaths.none { it != null && filePath.startsWith(it) }
342+
return normalizedPath.startsWith(externalStoragePath) &&
343+
appPrivatePaths.none { it != null && normalizedPath.startsWith(it) }
340344
}
341345
}

packages/capacitor-plugin/package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/capacitor-plugin/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@capacitor/file-transfer",
3-
"version": "0.0.1",
3+
"version": "1.0.3",
44
"description": "The FileTransfer API provides mechanisms for downloading and uploading files.",
55
"main": "./dist/plugin.cjs",
66
"module": "./dist/plugin.mjs",
@@ -55,7 +55,7 @@
5555
"semantic-release": "semantic-release"
5656
},
5757
"dependencies": {
58-
"@capacitor/synapse": "^1.0.2"
58+
"@capacitor/synapse": "^1.0.3"
5959
},
6060
"devDependencies": {
6161
"@capacitor/android": "^7.0.0",

packages/capacitor-plugin/release.config.cjs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ module.exports = {
88
plugins: [
99
'@semantic-release/commit-analyzer',
1010
'@semantic-release/release-notes-generator',
11-
'@semantic-release/changelog',
11+
[
12+
"@semantic-release/changelog",
13+
{
14+
"changelogFile": "../../CHANGELOG.md"
15+
}
16+
],
1217
'@semantic-release/npm',
1318
[
1419
'@semantic-release/github',
@@ -18,14 +23,14 @@ module.exports = {
1823
releasedLabels: false,
1924
addReleases: 'bottom',
2025
releaseNotes: {
21-
changelogFile: 'CHANGELOG.md',
26+
changelogFile: '../../CHANGELOG.md',
2227
},
2328
},
2429
],
2530
[
2631
'@semantic-release/git',
2732
{
28-
assets: ['CHANGELOG.md', 'package.json'],
33+
assets: ['../../CHANGELOG.md', 'package.json'],
2934
message: 'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}',
3035
},
3136
],

packages/example-app/android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
namespace "com.example.plugin"
4+
namespace "com.capacitorjs.exampleapp.plugins.filetransfer"
55
compileSdk rootProject.ext.compileSdkVersion
66
defaultConfig {
7-
applicationId "com.example.plugin"
7+
applicationId "com.capacitorjs.exampleapp.plugins.filetransfer"
88
minSdkVersion rootProject.ext.minSdkVersion
99
targetSdkVersion rootProject.ext.targetSdkVersion
1010
versionCode 1

0 commit comments

Comments
 (0)