Sfoglia il codice sorgente

better handling of POST

master
Pascal Gloor 5 anni fa
parent
commit
200a0804bd
1 ha cambiato i file con 16 aggiunte e 2 eliminazioni
  1. 16
    2
      cgi/autodoc.fcgi

+ 16
- 2
cgi/autodoc.fcgi Vedi File

@@ -272,7 +272,21 @@ sub api_v1_POST_documents {
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
sub api_v1_GET_documents_id_image {
@@ -429,7 +443,7 @@ sub parse_post {
$data = $tmp;
}

return $data;
return { ctype => $ct, len => $len, data => $data);
}

sub sqlconnect {

Loading…
Annulla
Salva