(file: UploadFile)
| 316 | uri.startsWith("file://") || uri.startsWith("content://"); |
| 317 | |
| 318 | const getLocalFileSize = async (file: UploadFile) => { |
| 319 | if (typeof file.size === "number" && file.size > 0) return file.size; |
| 320 | |
| 321 | const info = await FileSystem.getInfoAsync(file.uri); |
| 322 | if (!info.exists || info.isDirectory) return 0; |
| 323 | return info.size; |
| 324 | }; |
| 325 | |
| 326 | const uploadNativeFile = async ( |
| 327 | method: "POST" | "PUT", |