paulman176
02/21/2023, 11:40 AMRAOUL
02/21/2023, 11:46 AMRazoth
02/21/2023, 12:04 PMRevaycolizer
02/21/2023, 1:18 PMconst savePic = async () => {
try {
const { error } = await supabase.storage.from("profiles").upload("file", file.value{
cacheControl: "3600",
upsert: false,
});
if (error) throw error;
statusMsg.value = "Successfully added";
file.value = null;
} catch (error) {
error.value = "Error: ${error.message}";
setTimeout(() => {
error.value = false;
}, 5000);
}
};
Crownie
02/21/2023, 1:21 PMmisakss
02/21/2023, 2:08 PMDeng
02/21/2023, 3:16 PMpatcito
02/21/2023, 3:35 PMejkreboot
02/21/2023, 4:00 PM.storage.from(...).list("", {limit: 2, sortBy: { column: 'created_at', order: 'desc' }})
(from the @supabase/supabase-js
npm package) I get the latest two folders as desired (or, if use order: 'asc'
, I get the oldest 2). Is it expected behavior that the time stamp fields on folders are all null
but the sorting works as expected?avalanche
02/21/2023, 4:35 PMsql
create extension cube with schema extensions;
create extension earthdistance with schema extensions;
Here is whole report, and I can see weird query under "internal_query".
json
{
"file": null,
"host": "",
"metadata": [],
"parsed": [
{
"application_name": null,
"backend_type": "client backend",
"command_tag": "DELETE",
"connection_from": "127.0.0.1:50632",
"context": "SQL function \"ll_to_earth\" during inlining\nSQL statement \"DELETE FROM ONLY \"public\".\"item\" WHERE $1 OPERATOR(pg_catalog.=) \"profile_id\"\"",
"database_name": "postgres",
"detail": null,
"error_severity": "ERROR",
"hint": null,
"internal_query": "SELECT cube(cube(cube(earth()*cos(radians($1))*cos(radians($2))),earth()*cos(radians($1))*sin(radians($2))),earth()*sin(radians($1)))::earth",
"internal_query_pos": 136,
"leader_pid": null,
"location": null,
"process_id": 65510,
"query": "DELETE FROM \"users\" AS users WHERE users.id = $1",
"query_id": -8180141769095057000,
"query_pos": null,
"session_id": "63f2b833.ffe6",
"session_line_num": 5,
"session_start_time": "2023-02-20 00:00:51 UTC",
"sql_state_code": "42704",
"timestamp": "2023-02-21 15:32:08.119 UTC",
"transaction_id": 3094,
"user_name": "supabase_auth_admin",
"virtual_transaction_id": "9/4898"
}
],
"parsed_from": null,
"project": null,
"source_type": null
}
Romi
02/21/2023, 4:35 PMAless.c06
02/21/2023, 4:39 PMRomi
02/21/2023, 5:43 PMCheqo
02/21/2023, 6:03 PMtext/plain;charset=UTF-8 - 14.38 KB
when I think it should be image/PNG
I thought supabase autoatically detect a type?
I don't know much about converting base64 to actual image files, so maybe my code is not right?
// file is a base64 string
let base64String = file.split(';base64,').pop();
if (!base64String) {
toast.error('Please upload a form template image');
return;
}
function getImageType(base64String: string): string | null {
const header = Buffer.from(base64String, 'base64').slice(0, 10);
if (header.slice(0, 2).equals(Buffer.from([0xff, 0xd8]))) {
return 'JPEG';
} else if (
header.slice(0, 4).equals(Buffer.from([0x89, 0x50, 0x4e, 0x47]))
) {
return 'PNG';
} else if (
header.slice(0, 4).equals(Buffer.from([0x47, 0x49, 0x46, 0x38]))
) {
return 'GIF';
} else if (header.slice(0, 2).equals(Buffer.from([0x42, 0x4d]))) {
return 'BMP';
} else {
return null;
}
}
const imageType = getImageType(base64String);
let inputBuffer = base64String && Buffer.from(base64String, 'base64');
and I am uploading here like this:
const { data: data1 } = await supabase.storage
.from('admin')
.upload(
`forms/${formConfigCreationData.id}/landing-picture.${imageType}`,
inputBuffer,
{
upsert: true
}
);
Can someone correct me as to what is going or is everything here ok?Romi
02/21/2023, 6:31 PMAaron8646
02/21/2023, 8:03 PMsecureStore
. I'm not seeing an obvious way to run supabase.auth.signUp()
without an email/password. Would supabase.auth.admin.createUser()
from the server work?nikivi
02/21/2023, 8:08 PMrchrdnsh
02/21/2023, 8:20 PMjs
const removeImage = async () => {
const { data, error } = await supabase
.storage
.from(`ads`)
.remove([`expressive_e/osmose/osmose_image_1_1677008672916.jpg`])
}
...which is called when a button is pushed:
html
<button on:click={removeImage}>Remove Image</button>
...but when the button is clicked the image is not removed in the supabase ui, but no errors anywhere...
...what am i doing wrong? And how can i find out?
...attaching an image of the file path, just in case i missed something obvious...DanMossa
02/21/2023, 8:29 PMauth.users
table. I also notice that sometimes updated_at
is later and sometimes last_sign_in_at
is later.
I'm curious when these get triggered?Revaycolizer
02/21/2023, 10:01 PMconst getPic=async() =>{
try{
const{data:projects, error} = await supabase.storage.getBucket("profiles")
if(error) throw error
(data.value =projects), (data Loaded.value =true)
} catch(error) {
error.value =error. message
setTimeout(() =>{
error.value = false
}, 5000)
}
}
caseycrogers
02/21/2023, 10:29 PMDotjosh
02/22/2023, 12:48 AMCELESTIALCITY
02/22/2023, 1:39 AMeloahsam
02/22/2023, 1:39 AM?????
02/22/2023, 1:44 AMsalzar
02/22/2023, 3:58 AMSjors
02/22/2023, 7:52 AMAless.c06
02/22/2023, 8:10 AMconst update_subscription = supabase
.from('lobbies')
.on('update', data => {
refreshPlayers();
}).subscribe();
Why does it gives me his error? I enabled realtime and have read for all users plicyelliott
02/22/2023, 8:15 AMSem_70
02/22/2023, 9:03 AM