Overview of direct transfer on Web client

Last Updated: Jul 28, 2017

Purpose

This tutorial uses two examples to show how to transfer the file in HTML form directly to the OSS.

  • Example 1: Describes how to add a signature on the server (PHP) and then upload the file directly to the OSS using a form.
  • Example 2: Describes how to add a signature on the server (PHP), and set the callback upon uploading on the server. Then, upload the form directly to the OSS. After that, the OSS calls back the application server and returns the result to the user.

Background

Every OSS user may use the upload service. Because the data is uploaded using Web pages, including some HTML5 pages in some apps, and there is a strong demand for the uploading service, many users choose to upload files to the application server through browsers/apps, and then the application server uploads the files to the OSS.

This method has three drawbacks:

  • Low uploading speed

    Files are first uploaded to the application server, and then to the OSS. Therefore, the workload of transmission over the Internet doubles. If data is directly transferred to the OSS without passing through the application server, the speed will increase significantly. Moreover, the OSS uses BGP bandwidth, thus ensuring a high speed for operators in different places.

  • Poor scalability

    As the number of users increases in the future, the application server may constitute a bottleneck.

  • High cost

    The traffic consumed for uploading files directly to the OSS is free of charge. If data is uploaded directly to the OSS without passing through the application server, the costs of several application servers can be saved.

Basic: The application server uses the PHP script language to return the signature

Click here to show the example

Advanced: The application server returns the signature using the PHP script language and implements uploading callback

Click here to show the example

Thank you! We've received your feedback.