Ich versuche, Supabase -Speicher in mein Android -App -Projekt zu integrieren. Ich habe eine Funktion, für die ein Bild als Profilbild eines Benutzers gespeichert werden muss, aber ich begegne weiter p>
Response Code: 404 -
404 Not Found
404
Not Found
The resource requested could not be found on this server!
Proudly powered by [url=http://www.litespeedtech.com/error-page]LiteSpeed Web Server[/url]
Please be advised that LiteSpeed Technologies Inc. is not a web hosting company and, as such, has no control over content found on this site.
< /code>
Ich habe versucht, nach einer Lösung im Internet zu suchen, insbesondere wie man Supabase in eine Android -Anwendung integriert, aber keiner von ihnen hat für mich funktioniert. > Ich habe einen Apiservice.java < /p>
@Multipart
@PUT("{bucket}/{fileName}")
Call uploadToS3(
@Header("Authorization") String authToken,
@Header("x-amz-acl") String acl, // Set to "public-read" if public
@Header("Content-Type") String contentType,
@Path("bucket") String bucket,
@Path("fileName") String fileName,
@Part MultipartBody.Part file
);
< /code>
Und dies ist mein Code zum Hochladen des Bildes auf dem Supabase -Server, aber es funktioniert nicht < /p>
private void uploadImageToSupabase(File imageFile) {
if (imageFile.length() == 0) {
Toast.makeText(getContext(), "Error: Empty file", Toast.LENGTH_SHORT).show();
return;
}
String fileName = UUID.randomUUID().toString() + ".jpg";
RequestBody requestBody = RequestBody.create(MediaType.parse("image/jpeg"), imageFile);
MultipartBody.Part body = MultipartBody.Part.createFormData("file", fileName, requestBody);
ApiService apiService = ApiClient.getInstance().create(ApiService.class);
Call call = apiService.uploadToS3(
SUPABASE_KEY, // Authorization token
"public-read", // ACL: public or private
"image/jpeg", // Content-Type
SUPABASE_BUCKET, // Bucket name
fileName, // File name
body
);
call.enqueue(new Callback() {
@Override
public void onResponse(Call call, Response response) {
if (response.isSuccessful()) {
String imageUrl = SUPABASE_URL + "/storage/v1/s3/" + SUPABASE_BUCKET + "/" + fileName;
saveImageDetails(imageUrl);
Toast.makeText(getContext(), "Upload successful!", Toast.LENGTH_SHORT).show();
} else {
try {
String errorBody = response.errorBody().string();
Log.e("Upload Error", "Response Code: " + response.code() + " - " + errorBody);
Toast.makeText(getContext(), "Upload failed: " + errorBody, Toast.LENGTH_LONG).show();
} catch (IOException e) {
e.printStackTrace();
}
}
}
@Override
public void onFailure(Call call, Throwable t) {
Toast.makeText(getContext(), "Error: " + t.getMessage(), Toast.LENGTH_SHORT).show();
}
});
}
Ich versuche, Supabase -Speicher in mein Android -App -Projekt zu integrieren. Ich habe eine Funktion, für die ein Bild als Profilbild eines Benutzers gespeichert werden muss, aber ich begegne weiter p> [code]Response Code: 404 -
404 Not Found
404 Not Found
The resource requested could not be found on this server!
Proudly powered by [url=http://www.litespeedtech.com/error-page]LiteSpeed Web Server[/url] Please be advised that LiteSpeed Technologies Inc. is not a web hosting company and, as such, has no control over content found on this site.
< /code> Ich habe versucht, nach einer Lösung im Internet zu suchen, insbesondere wie man Supabase in eine Android -Anwendung integriert, aber keiner von ihnen hat für mich funktioniert. > Ich habe einen Apiservice.java < /p> @Multipart @PUT("{bucket}/{fileName}") Call uploadToS3( @Header("Authorization") String authToken, @Header("x-amz-acl") String acl, // Set to "public-read" if public @Header("Content-Type") String contentType, @Path("bucket") String bucket, @Path("fileName") String fileName, @Part MultipartBody.Part file ); < /code> Und dies ist mein Code zum Hochladen des Bildes auf dem Supabase -Server, aber es funktioniert nicht < /p> private void uploadImageToSupabase(File imageFile) { if (imageFile.length() == 0) { Toast.makeText(getContext(), "Error: Empty file", Toast.LENGTH_SHORT).show(); return; }
Ich habe die folgende Tabelle in Supabase, in der ich die Postgis-Erweiterung installiert habe:
create table
public.prueba (
id smallint generated by default as identity not null,
name text null,...
Ich habe die folgende Tabelle in Supabase, in der ich die Postgis-Erweiterung installiert habe:
create table
public.prueba (
id smallint generated by default as identity not null,
name text null,...
Ich führe derzeit ein Projekt auf Aitoolclouds.com aus, in dem ich verschiedene KI-Tools (wie Text-to-Image, Chatbots-Generatoren, Hintergrundentferner usw.) präsentiere und überprüfe)
möchte es...