From a291d3b16f9c6663d846142cc272626cf3137ff0 Mon Sep 17 00:00:00 2001 From: Andrew Patton Date: Mon, 20 Jan 2025 06:47:24 -0800 Subject: [PATCH] =?UTF-8?q?Rename=20file=20upload=20docs=E2=80=99=20resour?= =?UTF-8?q?ce=20route=20file=20(#12778)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/how-to/file-uploads.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/how-to/file-uploads.md b/docs/how-to/file-uploads.md index 369f7ece60..d77f064a06 100644 --- a/docs/how-to/file-uploads.md +++ b/docs/how-to/file-uploads.md @@ -23,7 +23,7 @@ import { export default [ // ... other routes route("user/:id", "pages/user-profile.tsx", [ - route("avatar", "api/upload-avatar.tsx"), + route("avatar", "api/avatar.tsx"), ]), ] satisfies RouteConfig; ``` @@ -115,7 +115,7 @@ Update the form's `action` to store files in the `fileStorage` instance. ```tsx filename=pages/user-profile.tsx import { - FileUpload, + type FileUpload, parseFormData, } from "@mjackson/form-data-parser"; import { @@ -181,12 +181,12 @@ export default function UserPage({ Create a [resource route][resource-route] that streams the file as a response. -```tsx filename=api/upload-avatar.tsx +```tsx filename=api/avatar.tsx import { fileStorage, getStorageKey, } from "~/avatar-storage.server"; -import type { Route } from "./+types/upload-avatar"; +import type { Route } from "./+types/avatar"; export async function loader({ params }: Route.LoaderArgs) { const storageKey = getStorageKey(params.id);