Js cross-domain upload file

Source: Internet
Author: User

Code on GitHub (https://github.com/andygithubchen/jsUpload), please read it in conjunction with the files on GitHub.

The main implementation of the JS cross-domain upload file, where the cross-domain currently only in two domain names point to the server in the same LAN. Of course, both of these options can be uploaded with the same domain name.

For example:

192.168.1.60    www.test.cn192.168.1.61    www.video.cn

If you want to upload files under the www.test.com domain name under the www.video.com domain name, you can use the following two scenarios:

Scenario one (under the Solution1 folder)

    1. Copy all files under public to the site root under the www.video.cn domain name
    2. Copy all files under Solution1 to the site root under the www.test.cn domain name
    3. The browser opens the www.test.cn domain name for uploading. After uploading, there will be a file file in the root directory of the www.video.cn domain name, which has just uploaded files.

      This scenario uses Jquery.uploadify.js. Using this scenario, the root directory of the two domain name should have crossdomain.xml file, its configuration can be understood by Google.

Scenario two (under the Solution2 folder)

    1. Copy all files under public to the site root under the www.video.cn domain name
    2. Copy all files under Solution2 to the site root under the www.test.cn domain name
    3. The browser opens the www.test.cn domain name for uploading. After uploading, there will be a file file in the root directory of the www.video.cn domain name, which has just uploaded files.

      This program is using bui this JS front-end frame, upload the progress of the style can be easily modified, you can go to the Bui official website (http://www.builive.com) to view the manual.

Js cross-domain upload file

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.