{"id":44,"date":"2024-05-15T15:53:16","date_gmt":"2024-05-15T15:53:16","guid":{"rendered":"https:\/\/winchester.discoverysummer.co.uk\/pre-uni\/?page_id=44"},"modified":"2026-06-06T16:52:48","modified_gmt":"2026-06-06T16:52:48","slug":"upload-photo-video","status":"publish","type":"page","link":"https:\/\/winchester.discoverysummer.co.uk\/pre-uni\/upload-photo-video\/","title":{"rendered":"Upload Photo\/Video"},"content":{"rendered":"<!--<div data-tf-widget=\"gQcgICK1\" data-tf-opacity=\"100\" data-tf-iframe-props=\"title=Winchester Photo Uploads\" data-tf-transitive-search-params data-tf-medium=\"snippet\" style=\"width:100%;height:500px;\"><\/div>\n<script src=\"\/\/embed.typeform.com\/next\/embed.js\"><\/script>-->\n    <div id=\"mm-uploader-wrap\" style=\"max-width:450px; border:1px solid #ddd; padding:25px; border-radius:12px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; box-shadow: 0 10px 25px rgba(0,0,0,0.05); background: #fff;\">\n        \n        \n            <div id=\"mm-geo-block\" style=\"display:none; text-align:center; padding:20px;\">\n                <svg width=\"50\" height=\"50\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"#cc0000\" stroke-width=\"2\"><circle cx=\"12\" cy=\"12\" r=\"10\"><\/circle><line x1=\"4.93\" y1=\"4.93\" x2=\"19.07\" y2=\"19.07\"><\/line><\/svg>\n                <h3 style=\"color:#cc0000; margin-top:15px;\">Access Denied<\/h3><p style=\"font-size:14px; color:#666;\">UK Access Only.<\/p>\n            <\/div>\n            \n            <div id=\"mm-form-container\">\n                <h3 style=\"margin-top:0; color:#1A125A; font-size: 1.5em; margin-bottom: 20px;\">Upload Photos or Videos<\/h3>\n                <form id=\"mm-drive-form\">\n                    <div style=\"margin-bottom:15px;\"><label style=\"display:block; margin-bottom:8px; font-weight:600; color: #444;\">Your Full Name<\/label><input type=\"text\" id=\"user_name\" required style=\"width:100%; border:1px solid #ccc; padding:12px; border-radius:6px; box-sizing: border-box;\"><\/div>\n                    <div style=\"margin-bottom:25px;\"><label style=\"display:block; margin-bottom:8px; font-weight:600; color: #444;\">Select Files<\/label><div id=\"mm-drop-zone\" style=\"border: 2px dashed #ccc; padding: 30px; border-radius: 8px; text-align: center; background: #fafafa; cursor: pointer;\"><p style=\"margin:0; color:#666; font-size: 14px;\">Click to browse files<\/p><p style=\"margin:8px 0 0; color:#888; font-size: 11px;\">Allowed: JPG, JPEG, PNG, MP4, MOV, AVI, MPG, MPEG, FLV, MKV, PDF, HEIC<\/p><input type=\"file\" id=\"mm-file-input\" multiple style=\"display: none;\"><\/div><div id=\"mm-file-list-container\" style=\"display:none; margin-top:15px; border: 1px solid #eee; border-radius: 8px;\"><div id=\"mm-file-items-wrap\"><\/div><div style=\"background: #f4f6ff; padding: 12px; border-top: 1px solid #eee; color: #1A125A; font-size: 0.85em; display: flex; justify-content: space-between;\"><span><strong>Total:<\/strong> <span id=\"mm-total-size\">0<\/span> MB<\/span><\/div><\/div><\/div>\n                    <div style=\"margin-bottom: 20px; text-align: center; font-size: 0.85em; color: #555; background: #f9f9f9; padding: 10px; border-radius: 6px; border: 1px solid #eee;\">Maximum total upload limit: 100 MB<\/div>\n                    <button type=\"submit\" id=\"mm-submit-btn\" style=\"background:#1A125A; color:white; border:none; padding:15px 24px; border-radius:6px; cursor:pointer; width:100%; font-weight:600; font-size:16px;\">START UPLOAD<\/button>\n                <\/form>\n            <\/div>\n            \n            <div id=\"mm-upload-progress-container\" style=\"display:none; margin-top:20px;\"><div style=\"width:100%; background:#eee; border-radius:10px; height:12px; overflow:hidden; margin-bottom: 10px;\"><div id=\"mm-progress-bar\" style=\"width:0%; height:100%; background:#1A125A; transition: width 0.3s ease;\"><\/div><\/div><p id=\"mm-progress-text\" style=\"text-align:center; font-size:0.95em; color:#1A125A; font-weight:bold; margin: 0;\">Preparing...<\/p><\/div>\n            <div id=\"mm-success-msg\" style=\"display:none; text-align:center; padding:20px;\"><svg width=\"64\" height=\"64\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"#22bb33\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"margin-bottom:15px;\"><path d=\"M22 11.08V12a10 10 0 1 1-5.93-9.14\"><\/path><polyline points=\"22 4 12 14.01 9 11.01\"><\/polyline><\/svg><h3 style=\"color:#1A125A; margin-top:0;\">Upload Complete!<\/h3><button onclick=\"location.reload()\" style=\"background:#1A125A; color:#fff; border:none; padding:12px 25px; border-radius:6px; cursor:pointer; font-weight:700;\">Upload More<\/button><\/div>\n        \n            <\/div>\n\n    <script>\n    document.addEventListener('DOMContentLoaded', function() {\n        const geoEnabled = true;\n        if (geoEnabled) {\n            fetch('https:\/\/winchester.discoverysummer.co.uk\/pre-uni\/wp-admin\/admin-ajax.php?action=mm_check_location')\n            .then(res => res.json())\n            .then(data => {\n                if (!data.success) { \n                    document.getElementById('mm-form-container').style.display = 'none'; \n                    document.getElementById('mm-geo-block').style.display = 'block'; \n                }\n            }).catch(err => console.error(\"Geo pipeline error: \", err));\n        }\n\n        const fileInput = document.getElementById('mm-file-input');\n        const dropZone = document.getElementById('mm-drop-zone');\n        const fileListWrap = document.getElementById('mm-file-items-wrap');\n        const listContainer = document.getElementById('mm-file-list-container');\n        if(!fileInput) return;\n        \n        const allowedExts = \"jpg, jpeg, png, mp4, mov, avi, mpg, mpeg, flv, mkv, pdf, heic\".split(',').map(e => e.trim().toLowerCase());\n        let uploadedFiles = [];\n        dropZone.onclick = () => fileInput.click();\n        fileInput.onchange = (e) => {\n            for (let file of e.target.files) { \n                const ext = file.name.split('.').pop().toLowerCase();\n                if (allowedExts.includes(ext) && !uploadedFiles.some(f => f.name === file.name)) uploadedFiles.push(file); \n            }\n            renderFileList();\n        };\n        function renderFileList() {\n            fileListWrap.innerHTML = ''; let total = 0;\n            uploadedFiles.forEach((file, index) => {\n                total += file.size;\n                fileListWrap.innerHTML += `<div class=\"mm-file-row\"><span>${file.name} <small>(${(file.size\/1048576).toFixed(1)}MB)<\/small><\/span><button type=\"button\" class=\"mm-remove-btn\" onclick=\"removeFile(${index})\"><svg width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"white\" stroke-width=\"3\"><line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\"><\/line><line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\"><\/line><\/svg><\/button><\/div>`;\n            });\n            document.getElementById('mm-total-size').textContent = (total \/ 1048576).toFixed(2);\n            listContainer.style.display = uploadedFiles.length ? 'block' : 'none';\n        }\n        window.removeFile = (i) => { uploadedFiles.splice(i, 1); renderFileList(); };\n        document.getElementById('mm-drive-form').onsubmit = async function(e) {\n            e.preventDefault();\n            const btn = document.getElementById('mm-submit-btn');\n            const pBar = document.getElementById('mm-progress-bar');\n            const pText = document.getElementById('mm-progress-text');\n            const pContainer = document.getElementById('mm-upload-progress-container');\n            btn.disabled = true; btn.innerHTML = 'PLEASE WAIT'; \n            pContainer.style.display = 'block';\n            for (let file of uploadedFiles) {\n                const init = await fetch('https:\/\/winchester.discoverysummer.co.uk\/pre-uni\/wp-admin\/admin-ajax.php?action=mm_get_url', { method: 'POST', headers: { 'Content-Type': 'application\/x-www-form-urlencoded' }, body: `name=${encodeURIComponent(document.getElementById('user_name').value)}&filename=${encodeURIComponent(file.name)}` });\n                const urlData = await init.json();\n                const uploadUrl = urlData.data;\n                const chunkSize = 5 * 1024 * 1024;\n                let start = 0;\n                while (start < file.size) {\n                    const end = Math.min(start + chunkSize, file.size);\n                    const isLast = (end === file.size);\n                    const controller = new AbortController();\n                    const timeoutId = setTimeout(() => controller.abort(), 25000); \n                    try {\n                        const chunkRes = await fetch(uploadUrl, { method: 'PUT', headers: { 'Content-Range': `bytes ${start}-${end-1}\/${file.size}` }, body: file.slice(start, end), signal: controller.signal });\n                        clearTimeout(timeoutId);\n                        start += chunkSize;\n                        const pc = Math.round((Math.min(start, file.size) \/ file.size) * 100);\n                        pBar.style.width = pc + '%';\n                        if (isLast) {\n                            pText.innerHTML = 'Processing...'; pBar.classList.add('mm-pulse');\n                            const drive = await chunkRes.json();\n                            await fetch('https:\/\/winchester.discoverysummer.co.uk\/pre-uni\/wp-admin\/admin-ajax.php?action=mm_log_final', { method: 'POST', headers: { 'Content-Type': 'application\/x-www-form-urlencoded' }, body: `id=${drive.id}&name=${encodeURIComponent(document.getElementById('user_name').value)}&file=${encodeURIComponent(file.name)}` });\n                            pBar.classList.remove('mm-pulse');\n                        } else { pText.innerHTML = `Uploading ${file.name}: ${pc}%`; }\n                    } catch (err) {\n                        if (isLast) {\n                            pText.innerHTML = \"Processing...\"; pBar.classList.add('mm-pulse');\n                            await fetch('https:\/\/winchester.discoverysummer.co.uk\/pre-uni\/wp-admin\/admin-ajax.php?action=mm_log_discovery', { method: 'POST', headers: { 'Content-Type': 'application\/x-www-form-urlencoded' }, body: `name=${encodeURIComponent(document.getElementById('user_name').value)}&file=${encodeURIComponent(file.name)}` });\n                            pBar.classList.remove('mm-pulse');\n                            break; \n                        }\n                    }\n                }\n            }\n            document.getElementById('mm-form-container').style.display = 'none'; pContainer.style.display = 'none'; document.getElementById('mm-success-msg').style.display = 'block';\n        };\n    });\n    <\/script>\n    <style>\n        .mm-file-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid #f0f0f0; font-size: 13px; color: #444; }\n        .mm-remove-btn { width: 22px !important; height: 22px !important; background: #cc0000 !important; border-radius: 4px !important; display: flex !important; align-items: center !important; justify-content: center !important; cursor: pointer !important; border: none !important; padding: 0 !important; }\n        .mm-pulse { animation: mmPulse 1.5s infinite; background: #22bb33 !important; }\n        @keyframes mmPulse { 0% { opacity: 1; } 50% { opacity: 0.4; } 100% { opacity: 1; } }\n    <\/style>\n    \n\n<style>\n.page-title {\n   display : none;\n}\n<\/style>\n\n<p><sub>By uploading, I give permission for Discovery Summer to use the photos\/videos for marketing purposes.<\/sub><\/p>\n","protected":false},"excerpt":{"rendered":"<p>By uploading, I give permission for Discovery Summer to use the photos\/videos for marketing purposes.<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"class_list":["post-44","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/winchester.discoverysummer.co.uk\/pre-uni\/wp-json\/wp\/v2\/pages\/44","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/winchester.discoverysummer.co.uk\/pre-uni\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/winchester.discoverysummer.co.uk\/pre-uni\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/winchester.discoverysummer.co.uk\/pre-uni\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/winchester.discoverysummer.co.uk\/pre-uni\/wp-json\/wp\/v2\/comments?post=44"}],"version-history":[{"count":5,"href":"https:\/\/winchester.discoverysummer.co.uk\/pre-uni\/wp-json\/wp\/v2\/pages\/44\/revisions"}],"predecessor-version":[{"id":194,"href":"https:\/\/winchester.discoverysummer.co.uk\/pre-uni\/wp-json\/wp\/v2\/pages\/44\/revisions\/194"}],"wp:attachment":[{"href":"https:\/\/winchester.discoverysummer.co.uk\/pre-uni\/wp-json\/wp\/v2\/media?parent=44"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}