Home > Back-end >  Delphi how to access the download link IE file name
Delphi how to access the download link IE file name

Time:09-26

Delphi how to access the download link IE filename
Such as the
http://common/fileupload/downloadFileServlet.do? A count=4028829 e4edfedge

How do I get to download the file name; Not=number later

CodePudding user response:

Didn't see you really want to get what, express, please.

CodePudding user response:

The page cannot be accessed

CodePudding user response:

reference 1st floor pathletboy response:
didn't understand what you really want to get what, the express, please
address for the file name

CodePudding user response:

refer to the second floor ksrsoft response:
page cannot be accessed
http://cywl.jb51.net:81/201209/books/W3CSchool_jb51net.rar like this I know string segmentation; Then I said type how to get the file name

CodePudding user response:

reference qq_29570025 reply: 3/f
Quote: refer to 1st floor pathletboy response:

Didn't understand what you want to get what, please express,
address for filename


Is to get the
reference
downloadFileServlet. Do
mean?

CodePudding user response:

reference 5 floor pathletboy reply:
Quote: refer to the third floor qq_29570025 response:

Quote: refer to 1st floor pathletboy response:

Didn't understand what you want to get what, please express,
address for filename


Is to get the
reference
downloadFileServlet. Do
mean?

Download file name is download address may not contain inside; How to obtain the actual file name

CodePudding user response:

refer to 6th floor qq_29570025 response:
Quote: refer to the fifth floor pathletboy reply:

Quote: refer to the third floor qq_29570025 response:

Quote: refer to 1st floor pathletboy response:

Didn't understand what you want to get what, please express,
address for filename


Is to get the
reference
downloadFileServlet. Do
mean?

Download file name is download address may not contain inside; How to get the actual filename

Had better give a sample url, you call of the roof

CodePudding user response:

Read the HTTP response Header inside the Content - Disposition can get the file name

 
The Content - disposition is an extension of the MIME protocol, the MIME protocol indicates the MIME user agent how to display additional files, when Internet Explorer receiving end, it will activate the file download dialog box, its file name box automatically populate the head of the specified file name, (please note that this is caused by design; Unable to use this feature to save the document to a user's computer, but not ask users to save the position,)

Server to the client browser to send a file, if it is a browser support file type, typically default browser to open, such as TXT, JPG, etc., can directly display in the browser, if you need to prompt the user to save, to use the Content - the Disposition, and the key is must add attachment:

The Response. AppendHeader (" the Content - the Disposition ", "legislation; Filename=filename. TXT ");

CodePudding user response:

IdHTTP1. Head (adress);
FileName:=IdHTTP1 Response. ContentDisposition;

The fileSize: IdHTTP1=. The Response. ContentLength;
  • Related