|
|
|
|
|
|
|
|
return db_get_document_object($id); |
|
|
return db_get_document_object($id); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
sub api_v1_POST_documents_id_data { return api_error(501,"Not yet implemented"); } |
|
|
|
|
|
|
|
|
sub api_v1_POST_documents_id_data { |
|
|
|
|
|
my($id, $qs, $post, $user) = @_; |
|
|
|
|
|
|
|
|
|
|
|
open(TMP,">/tmp/upload.meta"); |
|
|
|
|
|
print TMP $post->{ctype} . "\n"; |
|
|
|
|
|
print TMP $post->{len} . "\n"; |
|
|
|
|
|
close(TMP); |
|
|
|
|
|
|
|
|
|
|
|
open(TMP,">/tmp/upload.data"); |
|
|
|
|
|
print TMP $post->{data} . "\n"; |
|
|
|
|
|
close(TMP); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (200, "application/json", { }) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
# get document image/thumbnail |
|
|
# get document image/thumbnail |
|
|
sub api_v1_GET_documents_id_image { |
|
|
sub api_v1_GET_documents_id_image { |
|
|
|
|
|
|
|
|
$data = $tmp; |
|
|
$data = $tmp; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return $data; |
|
|
|
|
|
|
|
|
return { ctype => $ct, len => $len, data => $data); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
sub sqlconnect { |
|
|
sub sqlconnect { |