stefano
stefano10mo ago

is there any way to also save the

is there any way to also save the uploaded file names? https://uploadstuff.dev/
3 Replies
ari
ari10mo ago
In the single file example, you could update the saveStorageId function to also save the file name:
ctx.db.insert("someTable", {
storageId: args.storageId,
fileName: args.fileName,
// ...
});
ctx.db.insert("someTable", {
storageId: args.storageId,
fileName: args.fileName,
// ...
});
stefano
stefanoOP10mo ago
sorry, that's clear. My question was how to pass the file name to the saveStorageId function in the first place
Michal Srb
Michal Srb10mo ago
For example in UploadButton single file example:
const saveAfterUpload = async (uploaded: UploadFileResponse[]) => {
await saveStorageId({
storageId: (uploaded[0].response as any).storageId,
fileName: uploaded[0].name,
});
};
const saveAfterUpload = async (uploaded: UploadFileResponse[]) => {
await saveStorageId({
storageId: (uploaded[0].response as any).storageId,
fileName: uploaded[0].name,
});
};

Did you find this page helpful?