Tomcat downloads .rar files as text, so that IE opens rarfiles as garbled characters. In this case, you do not have to consider it a browser problem, most browsers should not expose binary files as text. Generally, the server opens binary files for any browser. solution:
Open CONF/Web. xml and add the following code.
Restart tomcat, clear ie cache, and download RAR files normally.
Common MIME types
Hypertext markup language text .htm,.html text/htm
I have read many methods
It seems that all of them are converted by response.
Code
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> Public Void Open (){ String Fullfilename = "" ; // ASP. NET File Download (the save file dialog box is displayed) // Fileurl is the full name of the
Recently found that IIS can not download the Chinese name of the file, feel very strange.
Version: WINDOWS2003SERVER+IIS6
It should be no problem.
Online check, said:
Open the registry in the run: Desktop left Corner "start" menu, run, enter "regedit", 98 version is "Regedit32", expand the following directory, hkey_local_machine\system\currentcontrolset\ Services\inetinfo\parameters\
Favordbcs the valu
1. What is an IFRAME?
The IFRAME closing tag creates an inline frame that contains another document, which can be placed between the IFRAME for browsers that do not support IFRAME.
The role of 2.iframe
(1) Download of file (attachment) via IFRAME
By hiding the IFRAME, when the Click event is triggered, the dynamic setting SRC will be able to implement the file
Implementation principle
(1) First get the length of the download file, and then set the length of the local file.
(2) Calculate the data length and the download location of each thread according to the file length and number of threads.
For example: the length of the
Due to the frequent use of file processing, they have encapsulated the next share to everyone. Contains the write text bulk delete file download file. --can be used directly////write to TXT //// public static void Writeintxt (string savepath, string content) { String temppath = System.IO.Path.GetDirectoryName (Savep
Copy codeThe Code is as follows: public static String toUtf8String (String s ){
StringBuffer sb = new StringBuffer ();For (int I = 0; I Char c = s. charAt (I );If (c> = 0 c Sb. append (c );} Else {Byte [] B;Try {B = Character. toString (c). getBytes ("UTF-8 ");} Catch (Exception ex ){Predictionutil. error ("an error occurred when converting Chinese characters in the file name into UTF-8 encoded strings. The input string is:" + s );B = new byte [0];}
PHP//temporarily does not support the continuation of the breakpoint//$url = ' http://www.mytest.com/debian.iso '; do not know why get local file size is 0 $url= ' HTTP://192.168.8.93/DOWNLOAD/VM-672/18/0.VMDK '; $file=basename($url); $header=get_headers($url, 1); $size=$header[' Content-length ']; $fp=fopen($url, ' RB '); if($fp===false)Exit('
Download
Set FSO = CreateObject ("Scripting.FileSystemObject")
Hu = Replace (Server.MapPath ("index.asp"), "index.asp", "") ' the Directory of the system
Set TestFolder = FSO. GetFolder (HU)Generatetestinformation = Generateallfolderinformation (TestFolder)
Function generateallfolderinformation (Folder)
Dim S, subfolders, subfolder, Files, File, ITmpstr = ""Set subfolders = Folder.subfolders
If s
The recent Ubuntu under CAJ reader, suddenly collapsed, and just want to prepare to open the question, in the online search reason did not, ready to give up time, suddenly see a script on the internet, said is very good, can be in the designated page will be CAJ file into a PDF file, pro-Test useful, here directly to the script link and installation method, Thank you very much,Convert CAJ
This is a piece of file download code. why is the downloaded file always empty ;? Php nbsp; functiondown_file ($ file_name, $ file_sub_dir) { nbsp; $ file_name = iconv ( quot; UTF-8 quot; this is the code for downloading a file, why is the downloaded file always empty?
Fu
Q: I want to change the name after uploading the file, and change the name after downloading.
For example, success"
The new and old file names are saved in the database (already done)
That is, the name of the downloaded file cannot be changed.
Code:Copy codeThe Code is as follows: Function dl (f, n)On error resume nextSet S = CreateObject ("Adodb. Stream ")
What is the reason for garbled characters?Each browser does not have the same encoding, Firefox uses base64.ie and Google uses URL encodingSo when we set the response header,Content-type Getservletcontext (). Getminetype (filename);Content-disposition accachment;filename= encoded filenameURL encodingname = Urlencoder.encode (filename, "UTF-8");Base64 encoding/**
The name of the incoming file for BASE64 encoding
@param fileName
@return*/pub
Tags: address Security Agency style National security Control open task led USAGet:access failed:550 failed to open file. (T1.log)The reason is limited by the SELinux security access control policy.
Popular Science:
SELinux (Security-enhanced Linux) is the implementation of the U.S. National Security Agency (NAS) for mandatory access control, where the process can access only those files that are needed in his tasks.
Execution:
[Email protected]
PHP mandatory file download function code. this function provides mandatory file download functions for users.
The code is as follows:
/********************* @ File-path to file*/Function force_download ($
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.