Follow-up Comment #3, patch #6053 (project mldonkey):
No, The Content-Disposition header must put behind the Content-Type header,
which is after the function http_add_bin_stream_header;
This patch will hint the browser to use a correct filename for the file been
previewing.
So after apply the patch , login use a HTTP interface, Choose
Transfer->Upload, click the "P" link to preview a file (shared or
downloading), the browser prompts you to save the file, which the filename
should be the name of the file but not "preview_upload";
The code looks like this on my computer:
with _ ->
add_reply_header r "Content-Length"
(Int64.to_string size);
zero, size
in
let len = String.length exten in
let exten = if len = 0 then exten
else String.lowercase (String.sub exten 1 (len - 1)) in
http_add_bin_stream_header r (extension_to_file_ext exten);
add_reply_header r "Content-Disposition"
(Printf.sprintf "inline;filename=\"%s\"" (Filename.basename
filename));
let s = String.create 200000 in
set_max_output_buffer r.sock (String.length s);
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/patch/?6053>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
_______________________________________________
Mldonkey-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/mldonkey-users