mldonkey-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Mldonkey-users] [patch #6053] A Patch to support filename hinting while


From: Chandler Ding
Subject: [Mldonkey-users] [patch #6053] A Patch to support filename hinting while use browser to preview files
Date: Sat, 30 Jun 2007 22:26:40 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4

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/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]