Skip to content

Commit

Permalink
Rename file upload docs’ resource route file (remix-run#12778)
Browse files Browse the repository at this point in the history
  • Loading branch information
acusti authored Jan 20, 2025
1 parent 36596ea commit a291d3b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/how-to/file-uploads.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
```
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit a291d3b

Please sign in to comment.