Λογότυπο Parspack S3 Upload

Parspack S3 Upload

Κοινότητα
MiladJoodi
parspack-s3-upload

Ανεβάστε εικόνες σε αποθηκευτικό χώρο αντικειμένων συμβατό με S3 της ParsPack από μια εφαρμογή Next.js App Router. Χρησιμοποιήστε το για την υλοποίηση μεταφορτώσεων εικόνων από την πλευρά του διακομιστή, τη διαμόρφωση του S3 client, δημόσιες ή προϋπογεγραμμένες διευθύνσεις URL αντικειμένων, την επικύρωση μεταφορτώσεων, πιστοποιημένες διαδρομές API ή την ειδική για την ParsPack διευθυνσιοδότηση τύπου path-style.

Επισκόπηση

ΕκδότηςMiladJoodi
Αποθετήριοskills
Όνομα δεξιότηταςparspack-s3-upload
Αστέρια
24
Διακλαδώσεις
1
Συνοδευτικά αρχεία
Μόνο οδηγίες
Άδεια χρήσηςMIT
Σύνδεσμοι
  • Οδηγίες σε Markdown

    Ένα αρχείο SKILL.md που το μοντέλο φορτώνει όταν χρειάζεται, ώστε να καταναλώνει token μόνο όταν ένα αίτημα είναι πράγματι σχετικό.

  • Λειτουργεί με οποιοδήποτε LLM

    Οι δεξιότητες AI είναι απλό Markdown, όχι κώδικας για συγκεκριμένο πάροχο, επομένως αυτή η δεξιότητα λειτουργεί με GPT, Claude, Gemini, Grok ή ένα τοπικό μοντέλο.

  • Αυτοτελής

    Όλα όσα χρειάζεται το μοντέλο περιλαμβάνονται στις οδηγίες — χωρίς επιπλέον αρχεία για συγχρονισμό.

  • Ανοιχτού κώδικα

    Δημοσιεύτηκε στο GitHub από τον λογαριασμό MiladJoodi. Ελέγξτε τα αρχεία της δεξιότητας στο αποθετήριο πριν την εγκαταστήσετε.

Εγκατάσταση

Εγκαταστήστε τη δεξιότητα AI Parspack S3 Upload στο TypingMind για να τη χρησιμοποιείτε με οποιοδήποτε LLM ή προσθέστε τη σε άλλον πράκτορα AI που διαβάζει αρχεία SKILL.md.

1

Εγκατάσταση στο TypingMind

Το TypingMind εγκαθιστά μια δεξιότητα απευθείας από τον φάκελό της στο GitHub — διαβάζει το SKILL.md, συγκεντρώνει τα συνοδευτικά αρχεία σε πακέτο και αποθηκεύει το αποτέλεσμα τοπικά.

  1. Ανοίξτε την εφαρμογή και μεταβείτε στα Πρόσθετα → Δεξιότητες.
  2. Επιλέξτε «Εγκατάσταση από GitHub».
  3. Επικολλήστε το παρακάτω URL του φακέλου της δεξιότητας και επιβεβαιώστε.
    https://github.com/MiladJoodi/skills/tree/main/skills/parspack-s3-upload
  4. Ενεργοποιήστε τη δεξιότητα σε κάθε συνομιλία όπου θέλετε να είναι διαθέσιμη.
Πρόσθετα → Δεξιότητες → Προσθήκη δεξιότητας → Από URL του GitHub, έπειτα επικολλήστε το URL του φακέλου και πατήστε «Συνέχεια».
2

Εγκατάσταση σε άλλον πράκτορα AI

Κάθε πράκτορας AI που υποστηρίζει τη μορφή Agent Skills μπορεί να χρησιμοποιήσει αυτή τη δεξιότητα — αντιγράψτε τον φάκελο στον κατάλογο δεξιοτήτων του.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/MiladJoodi/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/skills/parspack-s3-upload .claude/skills/parspack-s3-upload
Επανεκκινήστε το Claude Code μετά την αντιγραφή, ώστε να εντοπίσει τη νέα δεξιότητα.

Χρησιμοποιήστε τη στο TypingMind

Ενεργοποιήστε τη δεξιότητα Parspack S3 Upload σε οποιαδήποτε συνομιλία στο TypingMind και το μοντέλο αναλαμβάνει τα υπόλοιπα. Το όνομα και η περιγραφή της περιλαμβάνονται στην προτροπή συστήματος και, μόλις προκύψει ένα σχετικό αίτημα, το μοντέλο φορτώνει μόνο του τις πλήρεις οδηγίες — δεν χρειάζεται ποτέ να την καλείτε χειροκίνητα και δεν καταναλώνει token μέχρι να χρησιμοποιηθεί πραγματικά.

Το μοντέλο φορτώνει αυτόματα τη δεξιότητα Parspack S3 Upload μόλις λάβει ένα σχετικό αίτημα.

Λειτουργεί με οποιοδήποτε μοντέλο AI

Οι δεξιότητες AI είναι οδηγίες σε απλό κείμενο Markdown και όχι κώδικας για συγκεκριμένο πάροχο, οπότε η δεξιότητα Parspack S3 Upload δεν περιορίζεται στο μοντέλο για το οποίο γράφτηκε. Εγκαταστήστε τη μία φορά στο TypingMind και χρησιμοποιήστε τη με GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ή ένα τοπικό μοντέλο που εκτελείτε εσείς — πάντα με τα δικά σας κλειδιά API.

  • Φόρτωση μόνο όταν χρειάζεται

    Η προτροπή συστήματος περιλαμβάνει μόνο το όνομα και την περιγραφή. Οι οδηγίες ανακτώνται με το πρώτο σχετικό αίτημα, οπότε μια δεξιότητα που δεν χρησιμοποιείται δεν έχει κόστος.

  • Αλλάξτε μοντέλο κατά τη διάρκεια της συνομιλίας

    Επειδή η δεξιότητα αποτελείται από οδηγίες και όχι από κώδικα, η αλλαγή μοντέλου δεν επηρεάζει τη λειτουργία της — το επόμενο μοντέλο διαβάζει το ίδιο αρχείο SKILL.md.

Οδηγίες δεξιότητας

Αυτό είναι το περιεχόμενο του αρχείου SKILL.md που φορτώνει το μοντέλο. Διαβάστε το πριν από την εγκατάσταση — μια δεξιότητα αποτελείται από οδηγίες που θα ακολουθήσει το μοντέλο σας.

ParsPack S3 Image Upload

Implementation guide for uploading images to ParsPack, an S3-compatible object storage provider, from a Next.js App Router project.

Use this guide when implementing the complete upload flow from browser to authenticated Next.js API route and then to ParsPack object storage.

The default architecture is:

text
Browser
  ↓ FormData
POST /api/upload
  ↓
Authenticated Next.js Route
  ↓
uploadImage()
  ↓
ParsPack S3
  ↓ PutObject
{ url, key }

ParsPack is treated as an S3-compatible provider. The important provider-specific details are:

  • Custom S3 endpoint
  • Path-style bucket addressing
  • Public object URL construction
  • Bucket permissions for direct public URLs

Keep credentials server-side. Never expose S3 access keys or secret keys to browser code.


1. Dependencies

Install the AWS SDK v3 S3 packages.

Run this command from the project root, where package.json is located:

bash
npm install @aws-sdk/client-s3 @aws-sdk/s3-request-presigner

If the project uses another package manager, use its equivalent command.

The application needs:

  • @aws-sdk/client-s3 for S3 operations
  • @aws-sdk/s3-request-presigner only when presigned URLs are required

Do not install the presigner package if the application only uses public objects.


2. Environment Variables

Create or update .env.local in the project root:

env
S3_ENDPOINT=https://YOUR_ACCOUNT.parspack.net
S3_BUCKET=your-bucket-name
S3_ACCESS_KEY_ID=your-access-key
S3_SECRET_ACCESS_KEY=your-secret-key
S3_REGION=us-east-1
S3_FORCE_PATH_STYLE=true
VariableRequiredNotes
S3_ENDPOINTYesExact ParsPack endpoint URL. Do not include a trailing slash.
S3_BUCKETYesBucket name.
S3_ACCESS_KEY_IDYesParsPack access key. Server-side only.
S3_SECRET_ACCESS_KEYYesParsPack secret key. Server-side only.
S3_REGIONNoDefaults to us-east-1 unless the provider specifies another value.
S3_FORCE_PATH_STYLENoDefaults to true.

Never expose these variables through:

text
NEXT_PUBLIC_*

or browser/client components.

Bucket permissions

If the application stores direct public URLs, uploaded objects must be publicly readable according to the bucket's access policy.

If the bucket is private, use presigned URLs instead.

Do not make an entire bucket public unless that is an intentional product requirement.


3. File Structure

A simple implementation can use:

text
lib/
  s3/
    client.ts
    urls.ts
    upload.ts

app/
  api/
    upload/
      route.ts

Responsibilities:

text
client.ts
  S3Client configuration and bucket access

urls.ts
  Public URL construction
  Presigned object URLs

upload.ts
  File validation
  Object key generation
  PutObject

route.ts
  Authentication
  FormData parsing
  HTTP responses

Keep the S3 credentials and upload implementation on the server.


4. S3 Client

Create:

text
lib/s3/client.ts

from the project root when referencing the path.

typescript
import { S3Client } from "@aws-sdk/client-s3";

function requireEnv(name: string): string {
  const value = process.env[name];

  if (!value) {
    throw new Error(`Missing required environment variable: ${name}`);
  }

  return value;
}

let client: S3Client | null = null;

export function getS3Client(): S3Client {
  if (client) {
    return client;
  }

  client = new S3Client({
    endpoint: requireEnv("S3_ENDPOINT"),
    region: process.env.S3_REGION ?? "us-east-1",
    credentials: {
      accessKeyId: requireEnv("S3_ACCESS_KEY_ID"),
      secretAccessKey: requireEnv("S3_SECRET_ACCESS_KEY"),
    },
    forcePathStyle: process.env.S3_FORCE_PATH_STYLE !== "false",
  });

  return client;
}

export function getS3Bucket(): string {
  return requireEnv("S3_BUCKET");
}

ParsPack path-style addressing

The important configuration is:

typescript
forcePathStyle: true

Path-style addressing produces a URL structure similar to:

text
https://endpoint/bucket/key

rather than:

text
https://bucket.endpoint/key

Do not remove forcePathStyle unless the actual ParsPack endpoint and bucket configuration support virtual-host-style addressing.


5. URL Helpers

Create:

text
lib/s3/urls.ts

Use path-style URLs for public objects:

typescript
import { GetObjectCommand } from "@aws-sdk/client-s3";
import { getSignedUrl } from "@aws-sdk/s3-request-presigner";
import { getS3Bucket, getS3Client } from "./client";

function trimTrailingSlash(value: string): string {
  return value.replace(/\/+$/, "");
}

function normalizeObjectKey(key: string): string {
  return key.replace(/^\/+/, "");
}

export function getPublicObjectUrl(key: string): string {
  const endpoint = trimTrailingSlash(process.env.S3_ENDPOINT ?? "");
  const bucket = getS3Bucket();
  const normalizedKey = normalizeObjectKey(key);

  return `${endpoint}/${bucket}/${normalizedKey}`;
}

export async function getPresignedObjectUrl(
  key: string,
  expiresIn = 3600
): Promise<string> {
  const command = new GetObjectCommand({
    Bucket: getS3Bucket(),
    Key: normalizeObjectKey(key),
  });

  return getSignedUrl(getS3Client(), command, {
    expiresIn,
  });
}

Example public URL:

text
https://YOUR_ACCOUNT.parspack.net/my-bucket/uploads/<ownerId>/<uuid>.jpg

Public vs private objects

For public objects:

text
getPublicObjectUrl()

is sufficient.

For private objects:

text
getPresignedObjectUrl()

should be used when the client needs temporary access.

Do not return permanent public URLs for private objects.


6. Upload Logic

Create:

text
lib/s3/upload.ts
typescript
import { PutObjectCommand } from "@aws-sdk/client-s3";
import { randomUUID } from "crypto";
import { getPublicObjectUrl } from "./urls";
import { getS3Bucket, getS3Client } from "./client";

const ALLOWED_CONTENT_TYPES = new Map([
  ["image/jpeg", "jpg"],
  ["image/png", "png"],
  ["image/webp", "webp"],
  ["image/gif", "gif"],
]);

const MAX_FILE_SIZE = 5 * 1024 * 1024;

export async function uploadImage(
  ownerId: string,
  file: File
): Promise<{ url: string; key: string }> {
  if (!ALLOWED_CONTENT_TYPES.has(file.type)) {
    throw new Error("Invalid file type");
  }

  if (file.size > MAX_FILE_SIZE) {
    throw new Error("File too large");
  }

  const extension = ALLOWED_CONTENT_TYPES.get(file.type)!;
  const key = `uploads/${ownerId}/${randomUUID()}.${extension}`;

  const buffer = Buffer.from(await file.arrayBuffer());

  await getS3Client().send(
    new PutObjectCommand({
      Bucket: getS3Bucket(),
      Key: key,
      Body: buffer,
      ContentType: file.type,
    })
  );

  return {
    key,
    url: getPublicObjectUrl(key),
  };
}

Design rules

The server must validate:

  • MIME type
  • File size
  • Ownership/scope
  • Authentication

Do not rely on client-side validation.

Object key

Use a predictable directory structure with an unpredictable object identifier:

text
uploads/{ownerId}/{uuid}.{ext}

For example:

text
uploads/user_123/550e8400-e29b-41d4-a716-446655440000.jpg

This provides:

  • Owner scoping
  • Collision resistance
  • Easy deletion
  • Easier debugging
  • Clear storage organization

Do not use the original filename as the object key.

Original filenames can contain:

  • Spaces
  • Unicode characters
  • Path-like strings
  • Unexpected extensions
  • Sensitive information

If the original filename is useful to the application, store it separately as metadata.


7. File Validation

MIME type validation is useful, but it is not a complete security boundary.

The browser controls the File.type value.

For higher-risk applications, validate the actual file content server-side.

For example, use an image parser or sharp when appropriate.

A production application may therefore validate:

text
1. Authentication
2. File presence
3. File size
4. Declared MIME type
5. Actual file signature/content
6. Image dimensions
7. Optional image processing

Do not trust:

text
file.name
file.type

as proof that a file is actually a valid image.

Filename extensions

Never derive authorization or storage behavior from an untrusted original extension.

Use the validated content type to determine the generated extension.


8. API Route

Create:

text
app/api/upload/route.ts

Example:

typescript
import { NextRequest, NextResponse } from "next/server";
import { getSession } from "@/lib/session";
import { uploadImage } from "@/lib/s3/upload";

export async function POST(request: NextRequest) {
  const session = await getSession();

  if (!session?.user?.id) {
    return NextResponse.json(
      { error: "Unauthorized" },
      { status: 401 }
    );
  }

  const formData = await request.formData();
  const file = formData.get("file");

  if (!file || !(file instanceof File)) {
    return NextResponse.json(
      { error: "No file provided" },
      { status: 400 }
    );
  }

  try {
    const result = await uploadImage(session.user.id, file);

    return NextResponse.json(result);
  } catch (error) {
    const message =
      error instanceof Error ? error.message : "Upload failed";

    const status =
      message === "Invalid file type" ||
      message === "File too large"
        ? 400
        : 500;

    return NextResponse.json(
      { error: message },
      { status }
    );
  }
}

Adapt:

text
@/lib/session

to the authentication system used by the application.

Contract

MethodPathAuthBodySuccess
POST/api/uploadAuthenticated sessionFormData{ url, key }

Expected errors:

text
401 → unauthenticated
400 → invalid request/file
500 → storage or unexpected server error

Do not return raw AWS/ParsPack errors to the client.

Log detailed server-side errors where the project's logging policy permits it, and return a safe client-facing message.


9. Request Limits

The S3 upload limit is not the only relevant limit.

Check the application's:

  • Reverse proxy
  • Hosting provider
  • Next.js runtime
  • Serverless function
  • Nginx configuration
  • Request body limits

A 5 MB application-level limit does not help if nginx rejects a request at 1 MB before it reaches Next.js.

Set infrastructure limits slightly above the application's intended limit when appropriate.


10. Client-side Usage

Client-side validation is for user experience only.

typescript
const MAX_IMAGE_SIZE = 5 * 1024 * 1024;

const ALLOWED_IMAGE_TYPES = [
  "image/jpeg",
  "image/png",
  "image/webp",
  "image/gif",
];

async function handleImageUpload(file: File) {
  if (!ALLOWED_IMAGE_TYPES.includes(file.type)) {
    throw new Error("Invalid file type");
  }

  if (file.size > MAX_IMAGE_SIZE) {
    throw new Error("File too large");
  }

  const formData = new FormData();

  formData.append("file", file);

  const res = await fetch("/api/upload", {
    method: "POST",
    body: formData,
  });

  if (!res.ok) {
    const data = await res.json().catch(() => null);

    throw new Error(data?.error || "Upload failed");
  }

  const { url } = await res.json();

  setForm((form) => ({
    ...form,
    imageUrl: url,
  }));
}

Important

The field name must be:

text
file

because the server reads:

typescript
formData.get("file")

Do not manually set:

http
Content-Type: multipart/form-data

in fetch.

The browser must generate the multipart boundary automatically.

File input

Use:

tsx
<input
  type="file"
  accept="image/jpeg,image/png,image/webp,image/gif"
/>

Disable or block duplicate submission while an upload is running.

Show useful states:

text
Idle
Uploading
Success
Error

For larger files, consider progress reporting and direct-to-S3 uploads.


11. Database Persistence

Do not automatically treat the returned URL as the only piece of storage information.

Prefer storing at least:

text
key
url

when the application may later need:

  • Deletion
  • Migration
  • Regeneration
  • Presigned access
  • Provider changes

For example:

ts
{
  imageUrl: result.url,
  imageKey: result.key,
}

The exact database model depends on the application.

If the URL format may change in the future, storing the key is especially useful because the URL can be reconstructed from the current storage configuration.


12. Next.js Image Configuration

If the application uses next/image with public ParsPack URLs, allow the exact ParsPack hostname.

In:

text
next.config.ts

use:

typescript
import type { NextConfig } from "next";

const nextConfig: NextConfig = {
  images: {
    remotePatterns: [
      {
        protocol: "https",
        hostname: "YOUR_ACCOUNT.parspack.net",
        pathname: "/**",
      },
    ],
  },
};

export default nextConfig;

Replace the hostname with the actual ParsPack endpoint host.

Do not use a wildcard hostname unless the project has a specific reason to do so.

After changing next.config.ts, restart the Next.js development server.


13. Authentication and Middleware

Keep authentication inside the upload route.

The route should explicitly verify the current user before accepting the file.

Do not rely only on a middleware redirect.

For example:

text
Browser
  ↓
POST /api/upload
  ↓
Route checks session
  ↓
Upload

If middleware protects application routes, make sure /api/upload is not converted into an HTML redirect for unauthenticated requests.

The API route should return:

json
{
  "error": "Unauthorized"
}

with HTTP 401.

This keeps API behavior predictable for fetch() clients.


14. Rate Limiting and Abuse Protection

An authenticated upload endpoint can still be abused.

For production systems, consider:

  • Per-user upload rate limits
  • Maximum upload count
  • Maximum total storage per user
  • Request throttling
  • File dimension limits
  • Content validation
  • Duplicate upload handling
  • Abuse monitoring

Authentication alone does not make an upload endpoint safe from excessive usage.


15. ParsPack-specific Checklist

When implementing or debugging ParsPack storage, verify:

  1. forcePathStyle is enabled.
  2. S3_ENDPOINT exactly matches the ParsPack endpoint.
  3. S3_ENDPOINT does not contain an accidental trailing slash.
  4. S3_BUCKET is correct.
  5. Access key and secret key are correct.
  6. Credentials exist only server-side.
  7. Public objects have the required bucket/object permissions.
  8. Public URL uses:
text
{S3_ENDPOINT}/{S3_BUCKET}/{key}
  1. The URL does not use:
text
https://bucket.endpoint/key

unless the actual provider configuration explicitly supports it. 10. next/image allows the ParsPack hostname when needed. 11. Region matches the provider's requirements. 12. CORS is not incorrectly added as a requirement for server-side uploads.

CORS

For:

text
Browser → Next.js → ParsPack

the browser is not directly talking to ParsPack.

CORS on the bucket is therefore generally not required for the upload request.

CORS becomes relevant when changing the architecture to:

text
Browser → ParsPack

using a presigned upload URL.


16. Common Failure Modes

SymptomLikely cause
Missing required environment variableEnvironment variables are missing or the server was not restarted.
403 / AccessDenied from S3Incorrect credentials or bucket permissions.
Upload succeeds but image returns 403Object/bucket is not publicly readable.
Upload succeeds but URL is wrongPath-style URL construction is incorrect.
URL uses bucket.endpointVirtual-host addressing is being used.
next/image refuses the URLParsPack hostname is missing from remotePatterns.
401 on uploadSession is missing or user is not authenticated.
File too largeServer-side size limit was exceeded.
Invalid file typeFile MIME type is not allowed.
Works locally but fails in productionDeployment environment variables or infrastructure request limits are missing.
Works directly but not through nginxReverse proxy body-size or timeout limit.
Upload works but browser cannot fetch objectPublic bucket/object policy or URL configuration problem.

17. Optional Extensions

Delete uploaded objects

Use DeleteObjectCommand with the stored key.

Keep the key because deletion should not depend on parsing a public URL.

Private buckets

For private objects:

  • Do not construct permanent public URLs.
  • Generate presigned GET URLs when access is needed.
  • Use a reasonable expiration time.
  • Authorize the requesting user before generating the URL.

Direct browser upload

For larger files:

text
Browser
  ↓
Next.js requests presigned PUT URL
  ↓
Browser → ParsPack

This reduces memory usage in the Next.js server.

Do not expose permanent S3 credentials to the browser.

Image processing

Use sharp when the application needs:

  • Resize
  • Compression
  • Format conversion
  • Thumbnail generation
  • Metadata removal

A common production flow is:

text
Upload
  ↓
Validate
  ↓
Process
  ↓
PutObject

Do not process untrusted images without considering resource limits.


18. Minimal Test Plan

From the project root, configure all required S3_* environment variables.

Then:

  1. Start the application.
  2. Log in as an authenticated user.
  3. Upload a small JPEG.
  4. Confirm the API returns:
json
{
  "url": "https://...parspack.net/bucket/uploads/...",
  "key": "uploads/..."
}
  1. Open the returned URL directly.
  2. Confirm the image loads.
  3. Save the URL/key to the relevant database record.
  4. Render the image through next/image.
  5. Test an invalid MIME type.
  6. Test a file larger than the configured limit.
  7. Test an unauthenticated request.
  8. Test the production deployment separately.

Optional curl test

From the project root, if the application is running locally:

bash
curl -X POST http://localhost:3000/api/upload \
  -F "file=@./test-image.jpg"

If authentication is required, include the appropriate authenticated session mechanism rather than disabling authentication just for testing.


19. Nginx Note

If uploads work locally but fail behind nginx with:

text
413 Request Entity Too Large

the reverse proxy is probably rejecting the request before it reaches Next.js.

For example:

nginx
client_max_body_size 10M;

Then reload nginx using the deployment's normal reload procedure.

The infrastructure limit should be greater than or equal to the application's intended upload limit.

Do not solve a 413 by blindly increasing the limit. Keep the application-level file-size validation in place.


20. Agent Rules

When implementing ParsPack uploads:

  1. Inspect the existing authentication system before creating a new one.
  2. Inspect the existing storage utilities before creating duplicate S3 helpers.
  3. Keep credentials server-side.
  4. Never put S3 secrets in client components.
  5. Use forcePathStyle for ParsPack path-style storage.
  6. Validate file size and type on the server.
  7. Do not trust the original filename.
  8. Generate collision-safe object keys.
  9. Keep the object key if future deletion or migration is possible.
  10. Use public URLs only for intentionally public objects.
  11. Use presigned URLs for private objects.
  12. Do not manually set multipart Content-Type in browser fetch.
  13. Do not disable authentication to make uploads work.
  14. Do not bypass bucket permissions to hide a configuration problem.
  15. Check next/image configuration when remote images fail.
  16. Check reverse-proxy body limits when uploads fail before reaching Next.js.
  17. Match the project's existing error-handling and logging conventions.
  18. Avoid introducing new architecture when the project already has an established upload abstraction.

21. Final Checklist

Before considering the implementation complete:

  • AWS SDK S3 packages are installed.
  • .env.local contains the required server-side variables.
  • Secrets are not exposed through NEXT_PUBLIC_*.
  • ParsPack endpoint is correct.
  • Bucket name is correct.
  • forcePathStyle is enabled.
  • S3 client is server-only.
  • Upload route requires authentication.
  • FormData field is named file.
  • Server validates MIME type.
  • Server validates file size.
  • Object keys do not use untrusted filenames.
  • Object keys are collision-safe.
  • Public/private storage behavior is intentional.
  • Public URL uses the correct path-style format.
  • next/image allows the ParsPack hostname when needed.
  • Client does not manually set multipart Content-Type.
  • Upload state prevents accidental duplicate submission.
  • Production request-size limits are configured.
  • Unauthorized requests return JSON 401.
  • Invalid files return 400.
  • Storage failures return a safe 500.
  • The returned object can be fetched successfully.
  • Database persistence stores the appropriate storage reference.
  • Delete/presigned access has been considered if required.

22. Scope

This skill covers ParsPack S3-compatible object storage integration for image uploads in a Next.js App Router application.

It does not prescribe:

  • A specific authentication provider
  • A specific database
  • A specific form library
  • A specific UI component library
  • A specific deployment platform
  • A specific image-processing pipeline

Adapt the examples to the existing project's architecture.

When modifying an existing project, inspect its current storage, authentication, database, validation, and error-handling patterns first. Reuse existing abstractions where possible instead of introducing parallel implementations.

Συχνές ερωτήσεις

Τι κάνει η δεξιότητα AI Parspack S3 Upload;

Ανεβάστε εικόνες σε αποθηκευτικό χώρο αντικειμένων συμβατό με S3 της ParsPack από μια εφαρμογή Next.js App Router. Χρησιμοποιήστε το για την υλοποίηση μεταφορτώσεων εικόνων από την πλευρά του διακομιστή, τη διαμόρφωση του S3 client, δημόσιες ή προϋπογεγραμμένες διευθύνσεις URL αντικειμένων, την επικύρωση μεταφορτώσεων, πιστοποιημένες διαδρομές API ή την ειδική για την ParsPack διευθυνσιοδότηση τύπου path-style.

Γιατί να χρησιμοποιήσετε τη δεξιότητα Parspack S3 Upload στο TypingMind;

Επειδή την εγκαθιστάτε μία φορά και τη χρησιμοποιείτε με οποιοδήποτε μοντέλο. Η Parspack S3 Upload είναι απλό Markdown και όχι κώδικας ειδικά για κάποιον πάροχο, επομένως η ίδια δεξιότητα λειτουργεί με GPT-5, Claude, Gemini, Grok ή ένα τοπικό μοντέλο — και μπορείτε να αλλάξετε μοντέλο κατά τη διάρκεια της συνομιλίας χωρίς να διακοπεί η λειτουργία της. Το TypingMind λειτουργεί με τα δικά σας κλειδιά API, οπότε πληρώνετε απευθείας τους παρόχους αντί για συνδρομή ανά θέση χρήστη, ενώ οι δεξιότητες και οι συνομιλίες σας παραμένουν στον δικό σας χώρο αποθήκευσης.

Πώς εγκαθιστώ τη δεξιότητα Parspack S3 Upload στο TypingMind;

Στο TypingMind, ανοίξτε Πρόσθετα → Δεξιότητες → Εγκατάσταση από το GitHub και επικολλήστε τη διεύθυνση https://github.com/MiladJoodi/skills/tree/main/skills/parspack-s3-upload. Το TypingMind διαβάζει το αρχείο SKILL.md και εγκαθιστά τη δεξιότητα, την οποία μπορείτε να ενεργοποιείτε ανά συνομιλία.

Ποια μοντέλα AI μπορούν να χρησιμοποιήσουν τη δεξιότητα Parspack S3 Upload;

Οποιοδήποτε μοντέλο συνδέετε στο TypingMind. Οι δεξιότητες AI είναι απλές οδηγίες Markdown και όχι κώδικας ειδικά για κάποιον πάροχο, επομένως τα GPT, Claude, Gemini, Grok και τα τοπικά μοντέλα μπορούν όλα να φορτώσουν αυτή τη δεξιότητα όταν ένα αίτημα αντιστοιχεί σε αυτή.

Με πόσα μοντέλα AI μπορώ να χρησιμοποιήσω τη δεξιότητα Parspack S3 Upload;

Με όσα θέλετε. Στο TypingMind μπορείτε να χρησιμοποιήσετε τη δεξιότητα Parspack S3 Upload με οποιοδήποτε μοντέλο υποστηρίζει δεξιότητες, όπως τα GPT, Claude, Gemini, Grok, DeepSeek, Mistral και Llama, χρησιμοποιώντας τα δικά σας κλειδιά API.

Είναι δωρεάν η δεξιότητα AI Parspack S3 Upload;

Ναι. Δημοσιεύεται στο GitHub από τον λογαριασμό MiladJoodi με την άδεια χρήσης MIT. Πληρώνετε μόνο τον δικό σας πάροχο AI για τα token που χρησιμοποιείτε.

Τι είναι οι δεξιότητες AI;

Μια δεξιότητα AI είναι ένα επαναχρησιμοποιήσιμο πακέτο οδηγιών που διδάσκει σε ένα μοντέλο AI πώς να εκτελεί μια συγκεκριμένη εργασία. Ακολουθεί την ανοιχτή μορφή Agent Skills: ένα αρχείο SKILL.md με όνομα και περιγραφή, μαζί με τυχόν σενάρια κώδικα, πρότυπα ή αρχεία αναφοράς που μπορεί να χρειαστεί το μοντέλο. Το μοντέλο διαβάζει τις οδηγίες μόνο όταν το αίτημά σας αντιστοιχεί στη δεξιότητα, οπότε μια εγκατεστημένη δεξιότητα δεν κοστίζει τίποτα μέχρι να χρησιμοποιηθεί.

Σε τι διαφέρουν οι δεξιότητες AI από τα πρόσθετα ή τους συνδέσμους MCP;

Ένα πρόσθετο ή ένας σύνδεσμος MCP παρέχει στο μοντέλο νέα εργαλεία που μπορεί να καλέσει — κώδικα που εκτελείται κάπου και επιστρέφει ένα αποτέλεσμα. Μια δεξιότητα AI παρέχει αντί γι’ αυτό γνώσεις και διαδικασίες στο μοντέλο: πώς να προσεγγίσει μια εργασία, ποια βήματα να ακολουθήσει και ποια χαρακτηριστικά έχει ένα καλό αποτέλεσμα. Οι δεξιότητες είναι απλό Markdown, επομένως δεν χρειάζονται διακομιστή, κλειδί API ή περιβάλλον εκτέλεσης και λειτουργούν με οποιοδήποτε μοντέλο.

Προβολή όλων

Δημιουργήστε τώρα τον δικό σας χώρο εργασίας AI

Εγγραφείτε στο ενημερωτικό μας δελτίο για να ενημερώνεστε για νέες λειτουργίες και μελλοντικές κληρώσεις δώρων 👇