Repo for the search and displace ingest module that takes odf, docx and pdf and transforms it into .md to be used with search and displace operations
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

37 lines
928 B

<?php
namespace App\Http\Controllers;
use App\Ingest\DocumentHandler;
class IngestController extends Controller
{
public function store()
{
request()->validate([
'id' => 'required',
'file_result_type' => 'required|in:md,original',
'document' => 'required|file',
]);
try {
$handler = new DocumentHandler(
request()->get('id'),
request()->get('file_result_type'),
request()->get('mime_type'),
request()->file('document')
);
$handler->handle();
return response()->json(array(
'status' => 'processing',
));
} catch (\Exception $exception) {
return response()->json([
'status' => 'error',
'message' => $exception->getMessage(),
], 400);
}
}
}