File upload in mobile app

NOVASOLUTIONS.TECHNOLOGY is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.
Development and support of all types of mobile applications:
Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1 servicesAll 1735 services
File upload in mobile app
Simple
from 1 business day to 3 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    756
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    624
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1054
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    947
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    862
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    445

Implementing File Upload in Mobile Application

File upload from a mobile device looks like a simple task until the first crash on Android 10+ due to URI changes in FileProvider, or until the first rejected review in App Store due to incorrect media library permissions. Let's break down what needs to be done correctly.

Typical Implementation Problems

On Android, the main pain is working with content:// URI instead of direct file paths. Starting with Android 10 (API 29), direct filesystem access is restricted, and attempts to pass file:// path directly to Retrofit/OkHttp result in FileUriExposedException. The correct approach is to read the file via ContentResolver.openInputStream() and pass the stream, not the path.

On iOS, access to the photo library requires correct Info.plist: NSPhotoLibraryUsageDescription for iOS 13 and below, PHPickerViewController for iOS 14+ (doesn't require full photo album permissions). Using outdated UIImagePickerController with .photoLibrary in 2024 leads directly to reviewer comment from Apple.

Implementation

Multipart upload via Retrofit on Android:

@Multipart
@POST("upload")
suspend fun uploadFile(
    @Part file: MultipartBody.Part,
    @Part("description") description: RequestBody
): Response<UploadResponse>

// calling:
val requestBody = file.asRequestBody("image/*".toMediaTypeOrNull())
val part = MultipartBody.Part.createFormData("file", file.name, requestBody)

For large files (video, archives) — streaming transfer via RequestBody with overridden writeTo to avoid loading entire file into memory.

On iOS use URLSession.uploadTask(with:from:) or Alamofire:

AF.upload(
    multipartFormData: { form in
        form.append(fileURL, withName: "file")
    },
    to: "https://api.example.com/upload"
).uploadProgress { progress in
    print(progress.fractionCompleted)
}.responseDecodable(of: UploadResponse.self) { response in
    // handle
}

Flutter: dio package with FormData and MultipartFile.fromFile(). Progress via onSendProgress.

It's important to handle upload progress separately — show ProgressBar/LinearProgressIndicator with real percentages, not spinner. Cancel upload via CancellationToken (Kotlin) or Task (Swift/Alamofire).

What's Included in the Work

Choice of approach (multipart, presigned S3 URL, chunked upload) depends on file size and infrastructure. Implement file picker for platform, permission handling, progress display, retry on network error.

Timeline: 1–2 days for standard case, up to 4 days if chunked upload with resumable behavior is needed.