Mooshay105
Mooshay105
TTCTheo's Typesafe Cult
Created by Mooshay105 on 2/27/2025 in #questions
t3.chat Captcha ERROR in zen
Malwarebytes block is issue
4 replies
TTCTheo's Typesafe Cult
Created by Sarvesh Patkar on 10/8/2024 in #questions
How do i add custom id in uploadthing?
Hope this is what you ment!
5 replies
TTCTheo's Typesafe Cult
Created by Sarvesh Patkar on 10/8/2024 in #questions
How do i add custom id in uploadthing?
server code (just read if from the headers):
import { createUploadthing, type FileRouter } from "uploadthing/next";
import { UploadThingError } from "uploadthing/server";

const f = createUploadthing();

const auth = (req: Request) => {
//Get the customId from the request headers
const customId = (req.headers as any).customid;
return { id: customId };
} // Fake auth function

export const ourFileRouter = {
imageUploader: f({ image: { maxFileSize: "4MB" } })
.middleware(async ({ req }) => {
const user = await auth(req);
if (!user) throw new UploadThingError("Unauthorized");
return { userId: user.id };
})
.onUploadComplete(async ({ metadata, file }) => {
console.log("Upload complete for userId:", metadata.userId);
console.log("file url", file.url);
return { uploadedBy: metadata.userId };
}),
} satisfies FileRouter;

export type OurFileRouter = typeof ourFileRouter;
import { createUploadthing, type FileRouter } from "uploadthing/next";
import { UploadThingError } from "uploadthing/server";

const f = createUploadthing();

const auth = (req: Request) => {
//Get the customId from the request headers
const customId = (req.headers as any).customid;
return { id: customId };
} // Fake auth function

export const ourFileRouter = {
imageUploader: f({ image: { maxFileSize: "4MB" } })
.middleware(async ({ req }) => {
const user = await auth(req);
if (!user) throw new UploadThingError("Unauthorized");
return { userId: user.id };
})
.onUploadComplete(async ({ metadata, file }) => {
console.log("Upload complete for userId:", metadata.userId);
console.log("file url", file.url);
return { uploadedBy: metadata.userId };
}),
} satisfies FileRouter;

export type OurFileRouter = typeof ourFileRouter;
5 replies
TTCTheo's Typesafe Cult
Created by Sarvesh Patkar on 10/8/2024 in #questions
How do i add custom id in uploadthing?
For the Button use the headers tag:
<UploadButton
endpoint="imageUploader"
onClientUploadComplete={(res) => {
// Do something with the response
console.log("Files: ", res);
alert("Upload Completed");
}}
onUploadError={(error: Error) => {
// Do something with the error.
alert(`ERROR! ${error.message}`);
}}
headers={{
customId: "abc"
}}
/>
<UploadButton
endpoint="imageUploader"
onClientUploadComplete={(res) => {
// Do something with the response
console.log("Files: ", res);
alert("Upload Completed");
}}
onUploadError={(error: Error) => {
// Do something with the error.
alert(`ERROR! ${error.message}`);
}}
headers={{
customId: "abc"
}}
/>
5 replies
TTCTheo's Typesafe Cult
Created by Marchewcia on 7/21/2024 in #questions
Theo's browser
@Marchewcia zen is based on Firefox and has that functionality
19 replies
TTCTheo's Typesafe Cult
Created by Mooshay105 on 12/11/2024 in #questions
utfs.io is blocked by malware bytes browser guard
Well it is not being flaged ny more
8 replies
TTCTheo's Typesafe Cult
Created by Mooshay105 on 12/11/2024 in #questions
utfs.io is blocked by malware bytes browser guard
because I am still getting it
8 replies
TTCTheo's Typesafe Cult
Created by Mooshay105 on 12/11/2024 in #questions
utfs.io is blocked by malware bytes browser guard
are you using the browser guard?
8 replies