Scripts to upload files to Bambu Lab printers from OrcaSlicer or similar. Used in LAN mode.
Use at your own risk: This service was vibe-coded using AI. The owner of this repo may not be able to provide support if it does not work in your case.
This service monitors a user-defined folder directory on your macOS system watching for newly saved files. When using "Export plate sliced file" or "Export all sliced file" in OrcaSlicer, save the .3mf files to that monitored folder.
Once the service detects a new file, it will run a shell script that:
- Will display a pop-up message allowing you to select which Bambu printers on your network (as configured in the shell script) to upload the file to via FTPS
- Place the file in an archive folder
- Make multiple attempts to upload
- Provide a notification on failure or on successful upload
- Maintain a transaction and error log
The guide explains how to install and configure the macOS FTPS folder watcher service.
The project includes:
ftps_upload_event.sh— FTPS upload scriptftps_wrapper.c— lightweight wrapper used bylaunchdcom.ftps.uploader.plist— LaunchAgent configuration
- macOS
- Xcode Command Line Tools
curl(included with macOS)
Open Terminal and run:
xcode-select --installIf already installed, macOS will display a message indicating that the tools are already present.
Create the required directories:
mkdir -p ~/binCopy the project files into place.
Copy:
ftps_upload_event.sh
To:
~/bin/ftps_upload_event.sh
Copy:
ftps_wrapper.c
To:
~/bin/ftps_wrapper.c
Copy:
com.ftps.uploader.plist
To:
~/Library/LaunchAgents/com.ftps.uploader.plist
Edit the following files and update any placeholders:
Set the placeholders to directories and printer information specific to your installation. The current code is set up for 2 printers and a pop-up message appears to select either printer or both to upload the file. In your configuration you can add additional printers or remove as needed.
Update:
WATCH_DIR="[DIRECTORY_TO_WATCH]"
ARCHIVE_DIR="[DIRECTORY_TO_WATCH]/uploaded"HOST_NAMES=(
"[FRIENDLY_NAME_PRINTER_1]"
"[FRIENDLY_NAME_PRINTER_2]"
){\"[FRIENDLY_NAME_PRINTER_1]\", \"[FRIENDLY_NAME_PRINTER_2]\", \"Both\"}case "$choice" in
"[FRIENDLY_NAME_PRINTER_1]")
hosts_to_use=("${HOSTS[0]}")
;;
"[FRIENDLY_NAME_PRINTER_2]")
hosts_to_use=("${HOSTS[1]}")
;;
"Both")Update with your actual macOS username:
<string>/Users/[USERNAME]/bin/ftps_wrapper</string>Update with your watch directory:
<string>[DIRECTORY_TO_WATCH]</string>Update with your actual macOS username:
"/Users/[USERNAME]/bin/ftps_upload_event.sh"Open Terminal and run:
gcc ~/bin/ftps_wrapper.c -o ~/bin/ftps_wrapperThis creates the executable:
~/bin/ftps_wrapper
Run:
chmod +x ~/bin/ftps_upload_event.sh
chmod +x ~/bin/ftps_wrapperLoad the service:
launchctl load ~/Library/LaunchAgents/com.ftps.uploader.plistAnytime a change is made to the script files reload this service using:
launchctl unload ~/Library/LaunchAgents/com.ftps.uploader.plist
launchctl load ~/Library/LaunchAgents/com.ftps.uploader.plistRun:
launchctl list | grep com.ftps.uploaderYou should see output similar to:
12345 0 com.ftps.uploader
The uploader writes logs to:
~/ftps_upload.log
View logs live:
tail -f ~/ftps_upload.logThe LaunchAgent should run automatically:
- at login
- after reboot
- in the background without opening Terminal
Create a test file in the watched folder:
Example:
touch ~/Documents/gcode/Bambu/test.txtYou should see upload activity appear in the log.
Reload the LaunchAgent:
launchctl unload ~/Library/LaunchAgents/com.ftps.uploader.plist
launchctl load ~/Library/LaunchAgents/com.ftps.uploader.plistRe-run:
chmod +x ~/bin/ftps_upload_event.sh
chmod +x ~/bin/ftps_wrapperCheck:
- FTPS server IP addresses
- FTPS usernames/passwords
- watched folder path
- firewall/network access
Check:
cat /tmp/ftps_upload.errand:
cat /tmp/ftps_upload.out- The service uses FTPS via
curl - Uploads are processed automatically in the background
- macOS notifications are generated for upload success/failure
- Multiple FTPS destinations are supported