Programming implementation download in Asp. Net, asp.net programming implementation

Source: Internet
Author: User

Programming implementation download in Asp. Net, asp.net programming implementation

I often see someone asking for the code for programming and downloading in Asp. Net in the forum, and some still want to resumable download or something.
The key to the problem lies in permissions. B/S and C/S are not just differences in appearance.

Download, as the name implies, is the download of the client. It is not called download. It is actually "uploading from server" to client ".

Some people want to "write a" file "that you intend to download to the client, which is no problem in the C/S structure, because it is written by the C-end. However, Asp.net does not work, and a permission error will pop up. Because the B/S structure does not have a C client for you, it is impossible for the S client to obtain the write permission on the client's hard disk, isn't it a big mess in the world?

The fundamental difference between upload and download is that one is "local active delivery" and the other is "local active delivery ". They all need one party to "take the initiative". The upload must have the write permission for the remote, and the download must have the read permission for the remote. The current situation is that the server does not have the read and write permissions on the client at all, so it is useless to write this code in B/S.


In another way, I don't want the server to take the initiative. Can I make the client take the initiative?
1. Download IE. This includes downloads specified in the Http protocol (a prompt indicating whether to download a connection file that cannot be opened by IE itself), which is the most convenient. You only need to give a super connection, no code is needed. The limitation is that it is only valid for "file types that cannot be opened by IE currently. This is why some people click the same item to open the browser. Some people prompt for download, that is, the browser is different (including components and versions ).
2. javascript requests files from the server and writes them to the hard disk by js. (I have never tried it, so I do not know whether it is feasible or not)
3. Write operations are performed by a client program other than the browser. C/S version is as simple as what it is because it has a client... In B/S, what is a "client program other than a browser" that you can access ?? That's right, Trojan! It's absolutely okay to put a Trojan ..) As for how to put it, that is another thing...
4. Let the client think that this is the IE Plug-in (this may be, maybe not, but you have to pretend to cheat it). This is a favorite method such as 3721. The limitation lies in that it is related to the browser settings. If you turn off the corresponding automatic options, you will not be able to rush!

Therefore, it is difficult to implement Asp.net on the server to require the client to "Download. Use other methods.

 

Related Article

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.