|
|
@@ -72,6 +72,17 @@ Future<Response> handleFileUpload(Request request) async {
|
|
|
// final timestamp ='${nowdt.year}${nowdt.month.toString().padLeft(2, '0')}${nowdt.day.toString().padLeft(2, '0')}_${nowdt.hour.toString().padLeft(2, '0')}${nowdt.minute.toString().padLeft(2, '0')}';
|
|
|
final timestamp = nowdt.millisecondsSinceEpoch.toString();
|
|
|
|
|
|
+ // No need to subscribe to channel
|
|
|
+ final channel = supabase.channel('csvhichstorage');
|
|
|
+ final res = await channel.sendBroadcastMessage(
|
|
|
+ event: "upload",
|
|
|
+ payload: {
|
|
|
+ "filename": filename,
|
|
|
+ "updated_at": now,
|
|
|
+ },
|
|
|
+ );
|
|
|
+ print(" realtime response: $res");
|
|
|
+
|
|
|
//upload file to storage archive bucket
|
|
|
try {
|
|
|
final archiveFilename = 'upload/${timestamp}_$filename';
|
|
|
@@ -90,17 +101,6 @@ Future<Response> handleFileUpload(Request request) async {
|
|
|
|
|
|
await processCsvData(tempFile, supabase);
|
|
|
|
|
|
- // No need to subscribe to channel
|
|
|
- final channel = supabase.channel('csvhichstorage');
|
|
|
- final res = await channel.sendBroadcastMessage(
|
|
|
- event: "upload",
|
|
|
- payload: {
|
|
|
- "filename": filename,
|
|
|
- "updated_at": now,
|
|
|
- },
|
|
|
- );
|
|
|
- print(" realtime response: $res");
|
|
|
-
|
|
|
//add filename ta list
|
|
|
uploadedFiles.add({
|
|
|
'filename': filename,
|