storage

java
package com.example.demo.controller;

import com.example.demo.dto.FileMetadata;
import com.example.demo.service.FileStorageService;
import org.springframework.core.io.Resource;
import org.springframework.http.HttpHeaders;

File upload and download handling

java spring-boot file-upload
by David Kumar 2 tabs
yaml
# Headless Service for stable DNS
apiVersion: v1
kind: Service
metadata:
  name: postgres
  namespace: production

Kubernetes StatefulSets for stateful workloads

kubernetes k8s statefulsets
by Ryan Nakamura 1 tab
php
<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

Resize and Store User Avatars with Intervention Image in Laravel

laravel file-upload image-processing
by codesnips 3 tabs
typescript
import { S3Client } from "@aws-sdk/client-s3";
import { createPresignedPost, PresignedPost } from "@aws-sdk/s3-presigned-post";
import { randomUUID } from "crypto";

const s3 = new S3Client({ region: process.env.AWS_REGION });
const BUCKET = process.env.UPLOAD_BUCKET!;

Pre-signed S3 upload from the browser

s3 security aws-sdk
by codesnips 3 tabs
python
import io
import os
from uuid import uuid4
from PIL import Image, UnidentifiedImageError

ALLOWED_FORMATS = {"JPEG", "PNG", "WEBP"}

Validate and Generate Image Thumbnails on a Flask Upload Endpoint With Pillow

flask pillow image-processing
by codesnips 3 tabs
php
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;

Laravel file storage with disk abstraction

laravel storage filesystem
by Carlos Mendez 3 tabs
java
@Entity
@Table(name = "stored_files")
public class StoredFile {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)

Spring Boot Multipart File Upload with Metadata Persistence and Validation

spring-boot multipart file-upload
by codesnips 3 tabs
python
import enum
import datetime as dt

from sqlalchemy import Column, Integer, String, BigInteger, Enum, DateTime
from sqlalchemy.orm import declarative_base

Streaming FastAPI File Uploads with a Background Validation Task

fastapi uploads background-tasks
by codesnips 3 tabs