File tree Expand file tree Collapse file tree 1 file changed +17
-10
lines changed Expand file tree Collapse file tree 1 file changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -149,20 +149,14 @@ function UploadBlob() {
149149 type = " text"
150150 required
151151 onChange = { ({ target : { validity , value } }) => {
152- if (validity .valid ) {
153- const file = new Blob ([value ], {
154- type: " text/plain" ,
155- });
156-
157- // Optional, defaults to `blob`.
158- file .name = " text.txt" ;
159-
152+ if (validity .valid )
160153 mutate ({
161154 variables: {
162- file ,
155+ file: new Blob ([value ], {
156+ type: " text/plain" ,
157+ }),
163158 },
164159 });
165- }
166160 }}
167161 />
168162 );
@@ -177,6 +171,19 @@ const mutation = gql`
177171` ;
178172```
179173
174+ To avoid the upload default file name ` blob ` , replace the ` Blob ` approach with ` File ` :
175+
176+ ``` ts
177+ new File (
178+ [value ],
179+ // Custom file name.
180+ " text.txt" ,
181+ {
182+ type: " text/plain" ,
183+ },
184+ );
185+ ```
186+
180187## Requirements
181188
182189- [ Node.js] ( https://nodejs.org ) versions ` ^20.9.0 || >=22.0.0 ` .
You can’t perform that action at this time.
0 commit comments