'error', 'message' => 'Invalid file format. Only JPEG, PNG, HEIC, and WEBP supported.']); exit; } $ext = pathinfo($file['name'], PATHINFO_EXTENSION); $filename = 'photo_' . time() . '_' . bin2hex(random_bytes(4)) . '.' . strtolower($ext); $targetPath = $uploadDir . $filename; if (move_uploaded_file($file['tmp_name'], $targetPath)) { echo json_encode(['status' => 'success', 'filename' => $filename]); } else { echo json_encode(['status' => 'error', 'message' => 'Failed to save uploaded file.']); } exit; } // API Endpoint: Retrieve JSON list of uploaded photos if (isset($_GET['api']) && $_GET['api'] === 'photos') { header('Content-Type: application/json'); $files = array_diff(scandir($uploadDir), array('.', '..')); $photos = []; foreach ($files as $f) { if (preg_match('/\.(jpg|jpeg|png|heic|webp)$/i', $f)) { $photos[] = [ 'url' => 'uploads/' . $f, 'time' => filemtime($uploadDir . $f) ]; } } // Sort newest first usort($photos, function($a, $b) { return $b['time'] - $a['time']; }); echo json_encode(array_values($photos)); exit; } ?> Surface Photo Frame & iOS Uploader

SyncFrame

Send Photos to Frame

Select photos from your iPhone library to instantly display on your Microsoft Surface digital frame.

Frame Photo Buffer Photo
``` --- ### 2. No-Build Shell Installer (`install.sh`) This script prepares the permissions and lets you immediately launch a local server on macOS without setting up complex web servers: ```bash:No-Build Installer:install.sh #!/bin/bash # SyncFrame Quick Setup Script (No-Build Installer) # Works on macOS and Linux shared hosting environments. echo "==================================================" echo " SyncFrame - Quick Server Setup (No PKG) " echo "==================================================" # Step 1: Create required directories UPLOAD_DIR="uploads" if [ ! -d "$UPLOAD_DIR" ]; then echo "[+] Creating uploads directory..." mkdir -p "$UPLOAD_DIR" else echo "[!] Uploads directory already exists." fi # Step 2: Set execution and file permissions echo "[+] Setting file permissions..." chmod 755 "$UPLOAD_DIR" chmod 644 index.php 2>/dev/null || true # Step 3: Verify PHP presence if command -v php &> /dev/null; then PHP_VERSION=$(php -v | head -n 1) echo "[+] PHP detected: $PHP_VERSION" else echo "[!] Warning: PHP CLI not found in PATH." echo " If using Apache/Nginx (e.g. InMotion Hosting), place these files in your web root (public_html)." fi # Step 4: Optional Built-In Server Launcher for macOS echo "" echo "--------------------------------------------------" echo " Installation Complete!" echo "--------------------------------------------------" echo "" echo "To host this on macOS immediately without Web Server configuration:" echo "Run the following command to start a temporary local server:" echo "" echo " php -S 0.0.0.0:8080" echo "" echo "Then access it from your iPhone or Surface via:" echo " http://:8080" echo "--------------------------------------------------" read -p "Do you want to start the PHP development server now? (y/N): " choice case "$choice" in y|Y ) echo "[+] Starting server on http://0.0.0.0:8080 ..." php -S 0.0.0.0:8080 ;; * ) echo "Done. You can upload these files directly via FTP/cPanel to InMotion Hosting." ;; esac