Vilatoro
TTCTheo's Typesafe Cult
•Created by Vilatoro on 4/11/2024 in #questions
UTApi - server SDK uploadFilesFromUrl module error
I am getting a weird bug when uploading images using the utapi uploadFilesFromUrl.
This is my server code for now, which is very similar to the one posted in the example.
I am using bun, elysia, and the code is written in TypeScript.
error in the module:
2 replies
TTCTheo's Typesafe Cult
•Created by Vilatoro on 3/26/2024 in #questions
uploadthing in a server side environment
9 replies
TTCTheo's Typesafe Cult
•Created by Vilatoro on 3/14/2024 in #questions
How to use upload thing with only OpenAPI Specs?
I have tryed using upload thing with my Elysia/react app, with uploadthing but I was not successful to set it up. So I decided to use the OpenAPI spec by it self instead.
This is my current fetch request, but I do not know why I keep getting an error:
'''
fetch('https://uploadthing.com/api/prepareUpload', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Uploadthing-Api-Key': Bun.env.MySecret,
'X-Uploadthing-Version': '6.4.0'
},
body: JSON.stringify({
callbackUrl: 'http://localhost:3000/upload-image2',
callbackSlug: 'upload-image2',
files: [{
name: 'userID.'+type,
size: 1,
}],
"routeConfig": [ image: { maxFileSize: "4MB",maxFileCount: 1, } ] ,
metadata: null
})
})
'''
'''
error:
{
"error": "Invalid request input",
"data": [
{
"code": "invalid_type",
"expected": "object",
"received": "string",
"path": [],
"message": "Expected object, received string"
}
]
}
'''
5 replies