Skip to content

feat(share): add option to share files to PWA#4227

Open
basert wants to merge 1 commit intoTandoorRecipes:developfrom
basert:share_target
Open

feat(share): add option to share files to PWA#4227
basert wants to merge 1 commit intoTandoorRecipes:developfrom
basert:share_target

Conversation

@basert
Copy link

@basert basert commented Nov 12, 2025

  • adjusts the manifest.json file to configure files option
  • add service-worker handling to intercept the POST request, write the file to shared cache and redirect to the vue app
  • adds handling in vue app to read the file from cache and preload the AI import view

This implements #4220

@CLAassistant
Copy link

CLAassistant commented Nov 12, 2025

CLA assistant check
All committers have signed the CLA.

@vabene1111
Copy link
Collaborator

thank you for your solution and effort. This is more complex than I had hoped it to be but looks like it works (i guess you probably tested it).

Do you have any ideas on how this could be done "easier" (like just populating the file upload with the proper path, not sure if that works). I will leave this open for a few days, maybe someone has an idea or maybe I have one, if not I will get it merged, I do like the feature.

@vabene1111 vabene1111 moved this to Todo in Tandoor 2 Nov 19, 2025
* adjusts the `manifest.json` file to configure `files` option
* add service-worker handling to intercept the POST request, write the file to shared cache and redirect to the vue app
* adds handling in vue app to read the file from cache and preload the AI import view
@basert
Copy link
Author

basert commented Nov 21, 2025

Yeah, unfortunately it's not as simple as opening a webpage with the file pre-bootstrapped. And I can see why, the file might be owned by the app itself and possibly doesn't even exist on the phones filesystem. So the app shares the file with the browser by POSTing it to the PWA.

I indeed tested it, but it's quite a fight to get the local copy running on my phone :D I had to expose it via a public hostname with valid HTTPS certificate.

To just test the internal handling (e.g. service-worker, upload page, ...), you can use this test html:

<!DOCTYPE html>
<html lang="en">
<body>
<form action="http://localhost:8000/recipe/import" method="post" enctype="multipart/form-data">
    <input id="data" type="file" name="data">
    <button type="submit">Upload</button>
</form>
</body>

@vabene1111 vabene1111 moved this from Todo to In Progress in Tandoor 2 Feb 12, 2026
@vabene1111 vabene1111 moved this from In Progress to Todo in Tandoor 2 Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

3 participants