Skip to content

Commit 78d3384

Browse files
docs(file-upload): move from core to symfony and update (#2094)
1 parent b232756 commit 78d3384

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

admin/file-upload.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Handling File Upload
22

3-
If you need to handle the file upload in the server part, please follow [the related documentation](../core/file-upload.md).
3+
If you need to handle the file upload in the server part, please follow [the related documentation](../symfony/file-upload.md).
44

55
This documentation assumes you have a `/media_objects` endpoint accepting `multipart/form-data`-encoded data.
66

core/graphql.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ composer require api-platform/graphql
1919
You can now use GraphQL at the endpoint: `https://localhost:8443/graphql`.
2020

2121
> [!NOTE]
22-
> If you used [the Symfony Variant thanks to Symfony Flex](../symfony/index.md#installing-the-framework)
23-
> or the Laravel variant, URLs will be prefixed with `/api` by default. For example, the GraphQL endpoint will be: `https://localhost:8443/api/graphql`.
22+
> If you used [the Symfony Variant thanks to Symfony Flex](../symfony/index.md#installing-the-framework) or the Laravel
23+
> variant, URLs will be prefixed with `/api` by default. For example, the GraphQL endpoint will be: `https://localhost:8443/api/graphql`.
2424
2525
## Changing Location of the GraphQL Endpoint
2626

@@ -2830,9 +2830,10 @@ Since the command prints the schema to the output if you don't use the `-o` opti
28302830
bin/console api:graphql:export > path/in/host/schema.graphql
28312831
```
28322832

2833-
## Handling File Upload
2833+
## Handling File Upload with Symfony
28342834

2835-
Please follow the [file upload documentation](file-upload.md), only the differences will be documented here.
2835+
If you use Symfony, please follow the [file upload documentation](../symfony/file-upload.md), only the differences
2836+
will be documented here.
28362837

28372838
The file upload with GraphQL follows the [GraphQL multipart request specification](https://github.com/jaydenseric/graphql-multipart-request-spec).
28382839

outline.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ chapters:
1414
- nelmio-api-doc
1515
- user
1616
- jwt
17+
- file-upload
1718
- title: "API Platform for Laravel"
1819
path: laravel
1920
items:
@@ -65,7 +66,6 @@ chapters:
6566
- elasticsearch
6667
- controllers
6768
- events
68-
- file-upload
6969
- jwt
7070
- form-data
7171
- bootstrap

core/file-upload.md renamed to symfony/file-upload.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
# Handling File Upload
2-
3-
As common a problem as it may seem, handling file upload requires a custom
4-
implementation in your app. This page will guide you in handling file upload in
5-
your API, with the help of
6-
[VichUploaderBundle](https://github.com/dustin10/VichUploaderBundle). It is
7-
recommended you [read the documentation of
8-
VichUploaderBundle](https://github.com/dustin10/VichUploaderBundle/blob/master/docs/index.md)
1+
# Handling File Upload with Symfony
2+
3+
As common a problem as it may seem, handling file upload requires a custom implementation in your app. This page will
4+
guide you in handling file upload in your API, with the help of[VichUploaderBundle](https://github.com/dustin10/VichUploaderBundle).
5+
It is recommended you [read the documentation of VichUploaderBundle](https://github.com/dustin10/VichUploaderBundle/blob/master/docs/index.md)
96
before proceeding. It will help you get a grasp on how the bundle works, and why we use it.
107

11-
**Note**: Uploading files won't work in `PUT` or `PATCH` requests, you must use `POST` method to upload files.
12-
See [the related issue on Symfony](https://github.com/symfony/symfony/issues/9226) and [the related bug in PHP](https://bugs.php.net/bug.php?id=55815) talking about this behavior.
8+
> [!NOTE]
9+
> Uploading files won't work in `PUT` or `PATCH` requests, you must use `POST` method to upload files.
10+
> See [the related issue on Symfony](https://github.com/symfony/symfony/issues/9226) and
11+
> [the related bug in PHP](https://bugs.php.net/bug.php?id=55815) talking about this behavior.
1312
1413
Enable the multipart format globally in order to use it as the input format of your resource:
1514

@@ -137,7 +136,7 @@ Note: From V3.3 onwards, `'multipart/form-data'` must either be including in the
137136
Returning the plain file path on the filesystem where the file is stored is not useful for the client, which needs a
138137
URL to work with.
139138

140-
A [normalizer](serialization.md#normalization) could be used to set the `contentUrl` property:
139+
A [normalizer](../core/serialization.md#normalization) could be used to set the `contentUrl` property:
141140

142141
```php
143142
<?php

0 commit comments

Comments
 (0)