fix: improve image extension handling and error reporting in upload functions
Some checks failed
Build App / build (push) Failing after 6m56s
Some checks failed
Build App / build (push) Failing after 6m56s
This commit is contained in:
@@ -776,7 +776,7 @@ function ImageRotatorFields({ form, onChange, onUrlsChange }: ImageRotatorFields
|
||||
if (result.canceled) return;
|
||||
const asset = result.assets[0];
|
||||
if (!asset.base64) { Alert.alert("Error", "Could not read image data."); return; }
|
||||
const ext = asset.uri.split(".").pop()?.toLowerCase() ?? "jpg";
|
||||
const ext = (asset.mimeType?.split("/")[1] ?? asset.uri.split(".").pop() ?? "jpg").toLowerCase();
|
||||
setUploading(true);
|
||||
try {
|
||||
const res = await fetch(`${BASE_URL}/push_upload_images`, {
|
||||
|
||||
Reference in New Issue
Block a user