Delphi Idhttpserver Server

Source: Internet
Author: User

Can the "Bubbling" Lazarus (964489899) 10:01:27 be copied into a string?
"Bubbling" Lazarus (964489899) 10:01:44 I want to enter it quickly .
"Legend" Chiny (19730622) 10:01:52Localdoc:=htmldirectory +arequestinfo.document;
If FileExists (Localdoc) then//file exists
Begin
If Ansisametext (Arequestinfo.command, ' HEAD ') then
Begin
Resultfile: = Tfilestream.create (Localdoc, Fmopenreador fmsharedenywrite);
Try
Aresponseinfo.responseno: = 200;
Aresponseinfo.contenttype: = GetMimeType (Localdoc);
Aresponseinfo.contentlength: = resultfile.size;
Finally
Resultfile.free;
End
End
Else
Begin
{if contentdisposition isEmpty, oneself add attachment:filename= "index.html";
The client is downloaded as an attachment, not a display}
Aresponseinfo.contentdisposition:=format (' inline:filename= '%s ', [Extractfilename (Localdoc)]);
Aresponseinfo.responseno: = 200;
If lowercase (extractfileext (localdoc)) = '. js ' Then
aresponseinfo.contenttype:= ' Application/x-javascript '
Else
Aresponseinfo.contenttype: =getmimetype (Localdoc); Submit MimeType for sending documents
Aresponseinfo.servefile (Acontext, Localdoc);
End
End
else//Document not found, returnback Error
Begin
Aresponseinfo.contenttext: = ' Error Params or bad Key ';
End
End;
"Legend" Chiny (19730622) 10:02:12 aresponseinfo.contenttype: = GetMimeType (Localdoc);
The main thing is this sentence, file type
"Bubbling" Lazarus (964489899) 10:02:28 thanks to the teacher for sharing
"Active" Shandong Rizhao Hongyuan <15906335806> 10:08:34 If you really want to transfer files for your mobile phone, you're really complicating the simple stuff.
"Active" Shandong Rizhao Hongyuan <15906335806> 10:08:41 If there are other uses, do not watch
"Bubbling" Lazarus (964489899) 10:11:17 has other uses. For example, you make a server, upload your own download files more convenient. Two computers can transfer files to each other
"Legend" Chiny (19730622) 10:11:47 file or FTP bar
"Bubbling" Lazarus (964489899) 10:12:33 nn
"Bubble" Lazarus (964489899) 10:12:55 i Baidu a bit most of the file types have.  Type of RAR file I didn't find it.
"Bubbling" Lazarus (964489899) 10:13:01 try the picture first.
"Legend" Chiny (19730622) 10:16:02 look down
Tidmimetable Object
ID component comes with the
"Legend" Chiny (19730622) 10:16:15getfilemimetype
"Bubbling" Lazarus (964489899) 10:17:33 nn.
"Active" Shandong Rizhao Hongyuan <15906335806> 10:18:10application/x-rar-compressed
"Bubbling" Lazarus (964489899) 10:18:18 I just tried the PDF type. Phone open Web page direct download file suffix is htm pc is normal
"Bubbling" Lazarus (964489899) 10:19:43
"Bubbling" Lazarus (964489899) 10:19:54@ Shandong Rizhao Hongyuan Thank you teacher
"Bubbling" Lazarus (964489899) 10:20:34@CHINY Teacher is there a problem with my code?  Mobile phone download is not. Download complete suffix is always htm
"Legend" Chiny (19730622) 10:21:28 This can not be copied
"Bubbling" Lazarus (964489899) 10:22:05 this to be removed? or change it into another form .
"Active" Shandong Rizhao Hongyuan <15906335806> 10:23:00 Determine the file format, set the output file type
"Active" Shandong Rizhao Hongyuan <15906335806> 10:23:11 by extension
"Legend" Chiny (19730622) 10:23:21
"Bubbling" Lazarus (964489899) 10:23:47 I'll try again .
"Bubbling" Lazarus (964489899) 10:44:37 good. Solved, that is, the file type problem. In addition, the mobile browser is too bad problem. If you change a browser, there's nothing wrong with it.
"Bubbling" Lazarus (964489899) 10:44:45 Thank you, Sir .

Delphi Idhttpserver Server

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.