Skip to content

Commit e600c89

Browse files
authored
Refresh button on site (#57)
* docs(contrib): update commit message examples with large file context * docs(readme): center align content and improve readability * feat(server): add support for large files - tested with files of 1, 1.5, 2, 2.5 GB - transfer times ranging 7-15 mins avg in ascending order - optimization needed for transfer speeds * feat: add backend API endpoints for refresh settings - Add RefreshSettings data class with enabled/intervalSeconds properties - Implement GET/POST /refresh-settings endpoints in KtorServer - Add refresh settings management to FileServerService - Support configurable auto-refresh intervals (5-300 seconds) * feat(ui): add manual and auto-refresh controls to footer - Replaced static footer text with interactive refresh section - Added manual refresh button with icon - Added auto-refresh status indicator - Added settings modal for enabling/disabling auto-refresh and setting interval - Updated HTML structure for better UX and configuration options * feat(auto-refresh): implement manual and auto-refresh logic with change detection - Added auto-refresh feature with interval, enable toggle, and countdown display - Implemented settings persistence via server and localStorage - Integrated change detection using file hash to avoid unnecessary reloads - Hooked up modal interactions for configuring refresh options - Replaced direct UI updates with forced refresh calls after file upload/delete * style(ui): add footer and refresh modal styling - Styled new footer layout with refresh controls and settings button - Added hover, active, and responsive styles for refresh controls - Styled settings modal form, inputs, and labels - Improved mobile layout with responsive adjustments * reverted changes in server file based on pr 56 feedback
1 parent 940df73 commit e600c89

8 files changed

Lines changed: 706 additions & 161 deletions

File tree

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ This setup live-reloads the site and forwards `/api/*` requests to the emulator.
5353

5454
- for code changes, Use commit messages with tags, e.g.:
5555

56-
- `fix(server): handle large file uploads`
57-
- `feat(main): add new button`
58-
- `tests: add tests for upload endpoint`
56+
- `fix(server): improve error handling for large file uploads`
57+
- `feat(ui): add progress indicator for file transfers`
58+
- `perf(server): optimize streaming for multi-GB files`
5959

6060
- Fork the repo and create a branch for your change.
6161
- Open a pull request

README.md

Lines changed: 55 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,74 @@
1-
# Transfer
2-
3-
A simple local file server app for Android. Download and upload files quickly across devices over Wi-Fi — no cables, no cloud.
4-
5-
<table>
6-
<tr>
7-
<td>
8-
<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/01.png" width="150px" />
9-
<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/02.png" width="150px" />
10-
<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/03.png" width="150px" />
11-
<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/04.png" width="150px" />
12-
<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/05.png" width="150px" />
13-
<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/06.png" width="150px" />
14-
</td>
15-
</tr>
16-
</table>
17-
18-
Transfer makes sharing files across your local network incredibly straightforward. Think of it as a temporary USB stick you can access from any computer or device with a web browser — but without the physical stick, powered by a clean and simple UI.
19-
20-
Basically, a better alternative to running `uploadserver` through Termux.
21-
22-
## The Problem It Solves
23-
24-
Imagine you need to transfer a file between your laptop and desktop — but you just want to send the file and move on:
25-
26-
* You don’t have a USB stick or cable handy
27-
* You don’t want to configure SMB (enable/run Samba, then download a client)
28-
* You don’t want to use the cloud — either because it’s slow, unprivate, or you simply don’t have easy access to it
29-
30-
## Key Features
31-
32-
* **Effortless LAN Sharing**: Once Transfer is active, it serves files from your chosen shared folder over HTTP. Any device on the same Wi-Fi can connect using a simple web address shown in the app.
33-
* **Configurable Security**:
34-
* **IP Permissions**: By default, new devices attempting to connect trigger an "Allow/Deny" popup on your phone, giving you control over who accesses your files. This can be turned off for trusted networks.
35-
* **Password Protection**: For an added layer, you can secure access with a password (off by default).
36-
* **Powerful CLI Access (curl-friendly)**:
37-
* Transfer works great with command-line tools. Upload files directly using `curl -T yourfile.txt <your-phone-ip>:8000`.Also,you can download files using`curl <phone-ip>:8000/yourfile.txt`.
38-
* **Dual Browse UI**: Manage and access your shared files directly within the Transfer app on your Android device, or through the intuitive web interface on any connected computer.
39-
* **Quick In-App Transfers**:
40-
* **Upload**: Easily select files from your phone’s storage to add them to the shared folder.
41-
* **Paste**: Paste text from your phone’s clipboard directly into a new `.txt` file in the shared folder with a single tap.
42-
43-
## How to get the app
44-
#### Recommended ways:
45-
1. from [IzzyOnDroid](https://apt.izzysoft.de/fdroid/index/apk/com.matanh.transfer) (use an F-Droid client like Neo Store, Droid-ify, or add IzzyOnDroid repo.)
46-
47-
<a href="https://apt.izzysoft.de/fdroid/index/apk/com.matanh.transfer">
48-
<img alt="Get it on IzzyOnDroid" src="https://gitlab.com/IzzyOnDroid/repo/-/raw/master/assets/IzzyOnDroidButtonGreyBorder_nofont.png" height="54">
1+
<h1 align="center">Transfer</h1>
2+
3+
<p align="center">
4+
<a href="https://github.com/matan-h/Transfer/releases">
5+
<img src="https://img.shields.io/badge/version-0.5.0-blue.svg" alt="Version">
6+
</a>
7+
<a href="LICENSE">
8+
<img src="https://img.shields.io/badge/license-MIT-green.svg" alt="License">
499
</a>
10+
<a href="https://developer.android.com/about/versions/10">
11+
<img src="https://img.shields.io/badge/platform-Android%2029+-brightgreen.svg" alt="Android">
12+
</a>
13+
</p>
5014

51-
2. [from Google play!](https://play.google.com/store/apps/details?id=com.matanh.transfer) - new
15+
<p align="center"><strong>A simple local file server for Android</strong></p>
5216

53-
#### Other ways
54-
Directly from [github releases](https://github.com/matan-h/Transfer/releases) (and you can also point Obtainium to this link.)
17+
<p align="center">
18+
Transfer files instantly across devices over Wi-Fi – no cables, no cloud, no hassle.
19+
</p>
5520

56-
## Getting Started
21+
## Screenshots
5722

58-
1. Install and open Transfer on your Android device.
59-
2. Grant necessary permissions and select a folder you wish to share (suggestion: create a new folder called `Storage` in your home directory).
60-
3. Tap "Start Server."
61-
4. The app will display an IP address (e.g., `http://192.168.1.X:8000`).
62-
5. Open this address in a web browser on any other device connected to the same Wi-Fi network.
63-
6. You're in! If IP permissions are on (default), you'll get a prompt on your phone to allow the new device.
23+
<p align="center">
24+
<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/01.png" width="150px" />
25+
<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/02.png" width="150px" />
26+
<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/03.png" width="150px" />
27+
<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/04.png" width="150px" />
28+
<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/05.png" width="150px" />
29+
<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/06.png" width="150px" />
30+
</p>
6431

65-
It's designed to be that simple. Enjoy your new wireless drive.
32+
## Features
6633

67-
## FAQ
68-
### Why does my browser show an error?
69-
If your browser displays errors like `ERR_SSL_PROTOCOL_ERROR`, `ERR_CONNECTION_CLOSED`, or `SSL_ERROR_RX_RECORD_TOO_LONG`, it's probably because you're trying to open the site using **HTTPS** instead of **HTTP**. To fix, change the URL from `https://...` to `http://....`
34+
- **One-tap server**: Start HTTP server instantly
35+
- **Cross-platform**: Access from any device with a web browser
36+
- **Secure**: Device permissions and optional password protection
37+
- **CLI-friendly**: Works with `curl` and command-line tools
38+
- **No internet required**: Works over local Wi-Fi only
7039

40+
## Installation
7141

72-
### Can I set a specific IP address to use every time?
73-
Yes, you can set a [static IP](https://junipersys.com/support/article/14695) on your Android device.
42+
**Recommended:**
43+
- [IzzyOnDroid](https://apt.izzysoft.de/fdroid/index/apk/com.matanh.transfer) (F-Droid)
44+
- [Google Play Store](https://play.google.com/store/apps/details?id=com.matanh.transfer)
7445

75-
### Can I use Transfer without an internet connection?
76-
Yes, Transfer works over your local Wi-Fi network, so an internet connection is not required. However, all devices must be connected to the same local network.
46+
**Alternative:**
47+
- [GitHub Releases](https://github.com/matan-h/Transfer/releases)
7748

78-
### What happens to files I share/upload to the Transfer
79-
Transfer copy the files to the shared folder you set earlier.
49+
## Quick Start
8050

81-
### What happens if you click `T0` in the app version screen
82-
It becomes `T1` :)
51+
1. Install Transfer and select a folder to share
52+
2. Tap "Start Server"
53+
3. Open the displayed IP address in any browser on the same Wi-Fi
54+
4. Allow access when prompted
8355

84-
## Planned changes
56+
## Usage
8557

86-
- [ ] add an option to change the port in the settings
87-
- [ ] fallback to hotspot IP in the display.
88-
- [x] automatically update the IP when Wifi changes
58+
1. Upload file(s)
59+
2. Download file(s)
60+
- Both in the app and the web interface.
61+
62+
## FAQ
63+
64+
**Browser shows SSL errors?** Use `http://` not `https://`
65+
**Need consistent IP?** Set up a [static IP](https://junipersys.com/support/article/14695) on your device
66+
**Files location?** Uploaded files go to your selected shared folder
8967

9068
## Contributing
9169

92-
Any contributions, bugs, or feedback are welcome!
93-
Feel free to open an issue or PR.
94-
To get started, look at the `CONTRIBUTING.md` file
70+
Check [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines. Issues and PRs welcome!
9571

9672
## License
97-
this repo is Licensed under the MIT license.
73+
74+
MIT License – see [LICENSE](LICENSE) file.

app/src/main/assets/index.html

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,25 @@ <h2>Available Files</h2>
6868
</main>
6969

7070
<footer>
71-
<p>Transfer App</p>
71+
<div class="footer-content">
72+
<p>Transfer App</p>
73+
<div class="refresh-controls">
74+
<button id="manual-refresh-button" class="refresh-button" title="Refresh files">
75+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
76+
<path d="M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"/>
77+
</svg>
78+
Refresh
79+
</button>
80+
<div id="auto-refresh-status" class="auto-refresh-status">
81+
<span id="refresh-timer-text">Auto-refresh: Off</span>
82+
</div>
83+
<button id="refresh-settings-button" class="settings-button" title="Configure auto-refresh">
84+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
85+
<path d="M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.22,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.22,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.68 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z"/>
86+
</svg>
87+
</button>
88+
</div>
89+
</div>
7290
</footer>
7391

7492
<!-- Custom Confirmation Modal HTML -->
@@ -86,6 +104,30 @@ <h2>Available Files</h2>
86104
</div>
87105
</div>
88106

107+
<!-- Refresh Settings Modal -->
108+
<div id="refresh-settings-modal-overlay" class="modal-overlay">
109+
<div class="modal-content">
110+
<h3>Auto-Refresh Settings</h3>
111+
<div class="settings-form">
112+
<div class="setting-item">
113+
<label for="refresh-enabled-checkbox">
114+
<input type="checkbox" id="refresh-enabled-checkbox">
115+
Enable auto-refresh
116+
</label>
117+
</div>
118+
<div class="setting-item">
119+
<label for="refresh-interval-input">Refresh interval (seconds):</label>
120+
<input type="number" id="refresh-interval-input" min="5" max="300" value="30">
121+
<small>Between 5 and 300 seconds</small>
122+
</div>
123+
</div>
124+
<div class="modal-buttons">
125+
<button id="settings-save-button">Save</button>
126+
<button id="settings-cancel-button">Cancel</button>
127+
</div>
128+
</div>
129+
</div>
130+
89131
<script src="/assets/script.js"></script>
90132

91133
</body>

0 commit comments

Comments
 (0)