fix: Supabase storage upload hatasını çözmek için dosya adlarındaki Türkçe karakterler ve boşluklar temizlendi

This commit is contained in:
mstfyldz
2026-08-12 11:22:05 +03:00
parent 571e1f63d1
commit e25bab8146
5 changed files with 47 additions and 2 deletions
+12
View File
@@ -0,0 +1,12 @@
require('dotenv').config();
const { createClient } = require('@supabase/supabase-js');
const supabaseUrl = process.env.SUPABASE_URL;
const supabaseKey = process.env.SUPABASE_SERVICE_ROLE_KEY || process.env.SUPABASE_ANON_KEY;
const supabase = createClient(supabaseUrl, supabaseKey);
async function run() {
const { data, error } = await supabase.storage.from('case-documents').upload('templates/test_user_id/test.txt', Buffer.from('hello'), { contentType: 'text/plain' });
if (error) console.error('Error:', error);
else console.log('Success:', data);
}
run();