nextcloud / nextcloud/ios

Remember last upload destination in iOS Share Extension

Open
#4,280 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Swift
Stars
2.5k
Forks
1k
Avg merge
2d 18h
Merged PRs (30d)
13

Description

When uploading multiple files to Nextcloud using the iOS Share Extension, the destination folder has to be selected again for every single file.

Example

I receive several documents as email attachments on my iOS-Device.

For the first attachment I select:

Mail → Share → Nextcloud → 1 → 2 → 3

The upload works correctly.

When I share the next attachment to Nextcloud, the Share Extension starts again at the root/home directory. I have to navigate through the complete folder hierarchy again:

1 → 2 → 3

This becomes cumbersome when saving several files one after another.

Suggested behavior

The Nextcloud Share Extension should remember the last (3-5) successfully used upload destination.

For example:

Upload a file to /1/2/3
Close the Share Extension.
Share another file to Nextcloud.
The Share Extension opens /1/2/3 again.

The user could still navigate to another directory normally.

If the remembered directory no longer exists or is unavailable, the Share Extension should simply fall back to the user's home/root directory.

Possible enhancement

A later enhancement could provide a small list of the last 3–5 upload destinations:

This list should be generated automatically from actually used upload destinations, rather than requiring users to maintain favorites.

However, simply remembering the last upload destination would already solve most of the problem.

Why this is useful

This is especially useful when multiple documents from Mail, Safari or other iOS applications need to be stored in the same Nextcloud folder.

Currently the directory navigation has to be repeated for every individual Share Extension invocation.

Remembering the last destination would significantly reduce the number of interactions without changing the existing upload workflow.

Implementation idea

From looking at the current Nextcloud iOS source, the Share Extension appears to initialize serverUrl with the user's home directory.

Instead of always starting from the home directory, the Share Extension could persist the last successfully used upload destination in the shared App Group UserDefaults.

Conceptually:

successful upload → store destination URL

and on the next invocation:

stored destination → if valid use it → otherwise home directory

This would keep the implementation relatively small and would not require any server-side changes.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the iOS Share Extension at the code that initializes serverUrl to the user's home directory, then trace the successful upload path. Persist the last successful destination in the shared App Group UserDefaults and verify that the next invocation reopens it, while an unavailable destination falls back to the home/root directory.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, swift
Domain
mobile
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
74/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.