for blogs or business posts. we could add attach a picture
Marcus
1
urgent
important
customer feedback zfrika
<!-- <main class="max-w-4xl mx-auto px-4"> <div class="content-card"> <div class="p-6 border-b bg-gray-50/50"> <div class="flex flex-wrap gap-3"> <div class="location-badge"> <span class="material-icons text-sm">public</span> <%= category?.countryName || category?.country %> </div> <div class="location-badge"> <span class="material-icons text-sm">map</span> <%= category?.stateName || category?.stateId %> </div> <div class="location-badge"> <span class="material-icons text-sm">location_city</span> <%= category?.cityName || category?.cityId %> </div> </div> </div> <div class="p-8"> <div class="flex items-center gap-4 mb-6 text-gray-500 text-sm"> <div class="flex items-center gap-1"> <span class="material-icons text-sm">calendar_today</span> <%= new Date().toLocaleDateString() %> </div> <div class="flex items-center gap-1"> <span class="material-icons text-sm">verified</span> Verified Post </div> </div> <div class="text-lg leading-relaxed text-gray-700 whitespace-pre-line mb-10"> <%= category?.body %> </div> <% if ( category?.imageUrl) { %> <img src="<%= category?.imageUrl %>" alt="Post image" class="preview-image" /> <% } <button onclick="toggleModal()" class="w-full sm:w-auto flex items-center justify-center gap-3 px-10 py-4 bg-indigo-600 text-white rounded-2xl font-bold hover:bg-indigo-700 hover:-translate-y-1 transition-all shadow-xl shadow-indigo-200"> <span class="material-icons">reply</span> Reply to Post </button> </div> </div> </mai
lets look at the post page, what it called? POST /create/ has the page with the title and content. add a field for picture and country and city. use edit picture to follow the steps of uplaoding a picture to the site. but do it on another page after you get the title and content. GET /zfrikadev/editpicture/98e87823ae8
we got the page to load.for the image and we can capture the image. now we need to hand the image to a directory for storing images. no datatoken was passed. No image file info was passed. we should save the document record temporarily. with the picture path. but if the user fails to publish. we delete the document and delete the picture on file. can we pass the req.file without saving it so that it only gets saved when the user selects publish. Picture is appearing in preview section. tryin to post to DB <form action="<%= BASE_URL_PATH %>/<%= category %>" method="POST" id="postForm">