fenkod2001's picture
mobile.html:10 Uncaught ReferenceError: onOpenCvReady is not defined
25df395 verified
Raw History Blame Contribute Delete
1.04 kB
```php
<?php
header('Content-Type: application/json');
// Simulate successful upload for demo purposes
echo json_encode([
'success' => true,
'message' => 'Document uploaded successfully',
'imageUrl' => 'http://static.photos/document/640x360'
]);
// In a real implementation, you would:
/*
// Check if file was uploaded
if (!isset($_FILES['document'])) {
http_response_code(400);
echo json_encode(['success' => false, 'message' => 'No file uploaded']);
exit;
}
$targetDir = "uploads/";
$fileName = basename($_FILES['document']['name']);
$targetPath = $targetDir . $fileName;
// Try to move uploaded file
if (move_uploaded_file($_FILES['document']['tmp_name'], $targetPath)) {
echo json_encode([
'success' => true,
'message' => 'File uploaded successfully',
'imageUrl' => $targetPath
]);
} else {
http_response_code(500);
echo json_encode(['success' => false, 'message' => 'Error uploading file']);
}
*/
?>
```
4. Let's update the mobile.html to include a loading state: