SShortSingh.
Back to feed

Direct Uploads and Background Thumbnails for Private Logistics Images

0
·36 views

The recommended approach has the browser upload original logistics images straight to a tenant-scoped private storage key, while a background Node.js worker generates the thumbnail. The Next.js API route handles authorization and job recording rather than proxying or resizing the file bytes. Tenant isolation is enforced by deriving all object keys from the authenticated tenant, so browser-supplied filenames cannot override the boundary. The main tradeoff is latency, since queued thumbnails are not immediately available, so synchronous generation is suggested only for small images with strict size limits. Upload completion is treated as a claim to verify against stored metadata rather than proof of validity.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

AiryNight Keeps Nighttime Bedroom Audio On-Device Rather Than Uploading It to the Cloud

The developers of AiryNight, a sleep-tracking app, analyze nighttime audio entirely on the phone instead of sending bedroom recordings to a server. They argue that continuous overnight recordings capture private household sounds that could be exposed by a breach, subpoena, or ownership change even after deletion promises. The app classifies probable snoring with an on-device model and produces a morning summary with a comparative per-hour score, with recordings excluded from backups and deletable at any time. The company acknowledges that purchases are verified through Apple or Google and that optional anonymous usage statistics may be sent, while stating that audio, journal entries, and night results do not leave the device. The app runs on Android 8 or later and iOS 15 or later, with the iOS version about 27.8 MB.

0
ProgrammingDEV Community ·

Java Security Review: Common High-Risk Sinks and Pitfalls in XML, Deserialization and Queries

A security article explains that the most dangerous Java vulnerabilities often hide in ordinary-looking code, where untrusted data flows into sensitive operations called sinks. It notes that default XML parsers in Java enable external entity resolution, exposing applications to file disclosure, server-side request forgery, and denial of service, and that the JDK version alone does not fix this. The author recommends explicitly disabling doctype declarations and external DTD and schema access, configuring these features before the builder is created. The piece also warns that native deserialization with ObjectInputStream and permissive polymorphic typing in Jackson can enable remote code execution, and advises restricting allowed classes with filters or validators. Finally, it highlights a subtle injection risk in dynamic sorting within Spring Data JPA, where unvalidated property names can bypass safeguards.

0
ProgrammingDEV Community ·

Founder Builds Pipeline That Automates Social Media Posting for His SaaS

A founder describes how he stopped manually writing social media posts for his SaaS product by building Bravio, a pipeline that automates the process. The system first reads the company's website to create a brand profile covering products, offers, and tone of voice. Post topics are drawn from real search questions and product features rather than generic tip lists. Content is produced in varied formats such as reels, images, and carousels, adapted automatically to each platform's length and hashtag norms. Finally, posts are scheduled across connected accounts, with comment-keyword DMs driving clicks to the product.

0
ProgrammingDEV Community ·

Unbounded Node.js In-Memory Cache Pushes Memory From 3.4 MB to 200 MB Under Load

A developer ran a Node.js service that cached HTTP responses in a plain Map with no size limit. Load testing with 4,000 requests, each using a unique URL, drove resident memory from 3.4 MB to 200.1 MB with no plateau, since the Map kept every entry reachable. The developer fixed the problem by capping the cache size and evicting the oldest entries, which kept memory flat at 13.6 MB under the same traffic and throughput. The write-up argues that unbounded in-memory caches are a memory leak that often only surfaces in production. It recommends a hard size limit with an eviction policy such as LRU, a TTL for stale data, and load testing with unique keys before shipping.