httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sorin Manolache <sor...@gmail.com>
Subject Re: Re: How to send a jpeg-file in Handler
Date Wed, 19 Jan 2011 13:17:54 GMT
2011/1/19 Whut  Jia <whut_jia@163.com>:
> Can I don't use sub-request??
> I want only a single picture to client;Just like the same as sending a text :
> r->content_type="text/html";
> ap_rputs("helloworld",r);
> return OK;
> Please help me !
> Thanks,
> ajxs
>

Try

apr_file_t *fd;
apr_file_open(&fd, "filename", APR_READ, 0, request->pool);
apr_off_t file_size = 0;
apr_file_seek(fd, APR_END, &file_size);
apr_size_t bytes_sent;
ap_send_fd(fd, request, 0, file_size, &bytes_sent);
apr_file_close(fd);


S

Mime
View raw message