stefano
stefano9mo 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
ari9mo 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
stefanoOP9mo 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 Srb9mo 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?