×
Community Blog How to Upload Files to Alibaba Cloud Object Storage with Node.js

How to Upload Files to Alibaba Cloud Object Storage with Node.js

In this article, you will get some information on how to use Node.js to upload content to Alibaba Cloud Object Storage Service from a web application.

Requirements

For you to follow through with this tutorial you will require the following:

  1. Subscribe to the Alibaba Cloud Object Storage Service to get secret access keys.
  2. Run Node.js and npm on your machine. Node.js Downloads contains further information on how to go about Node installation.

In summary, you will require an Alibaba Cloud account, Object Storage Service, Node.js, npm and access keys to your OSS service.

How to Add Access Keys to the Credentials File

To begin with, the Alibaba Cloud OSS supports RESTful API operations and SDKs for most languages. In this tutorial, we are going to use the open-source OSS JavaScript SDK for node.js. We need to first install the ali-oss like so:

npm install ali-oss

Noteworthy, there are two modes that you can choose from; synchronous and asynchronous modes.

To use in synchronous mode, you may additionally use it in conjunction with co. Install co like so:

npm install co

The asynchronous mode supports callback.

Then you can go to How to Use Node.js to Upload Files to Alibaba Cloud Object Storage to check how to initialize the Client, install dependencies, create the front-end App, set up server with express and then upload the files.

Related Blog Posts

Getting Started with Node.JS on Alibaba Cloud

By Alex Mungai Muchiri, Alibaba Cloud Tech Share Author. Tech Share is Alibaba Cloud's incentive program to encourage the sharing of technical knowledge and best practices within the cloud community.

The Node.JS JavaScript framework was developed by Ryan Dahl in 2009 and is suitable for rapid development of highly scalable network applications. It is a server-side platform that is based on the V8 Engine (Chrome JE). It is particularly useful when building data-intensive real-time web applications because of its event-driven non-blocking I/O model. Its performance on distributed devices is impeccable for its lightweight and efficient architecture. Notably, Node.js is an open source, a cross-platform environment that runs across OS X, Microsoft Windows, and Linux. Developers use it for server-side and network application development.

Routing with Node.JS on Alibaba Cloud

In this tutorial, we will be examining the methods of routing using Node.js. Hopefully, you have already grasped the fundamental principles of Node.JS. We will be examining the essentials of Node.js routing using Express. Specifically, we will explore two methods and examples for the case study.

For most programming languages, routing is an essential component of programming techniques. Older routing applications were tedious and most cases prone to errors. However, modern programming languages use advanced methods that have made programming much easier to implement.

Related Market Products

There are some products with node.js built by partners can be quickly launched on Alibaba Cloud servers.

ParseServer powered by Websoft9(Ubuntu16.04)

ParseServer is the open source version of the Parse backend, and related projects.Parse Server is an open source version of the Parse backend that can be deployed to any infrastructure that can run Node.js.Parse Server works with the Express web application framework. It can be added to existing web applications, or run by itself.

RealSight APM V2.0 on CentOS 7.2

RealSight APM is a much easy to use and much powerful management platform for monitoring application health state, performance, cloud resources, user experience and relevant resources of applications running in cloud. It can help you to constantly monitoring your applications and release you from the cumbersome operation works.

The components of this Image

JDK1.6-node.js 0.8.23- PostgreSQL9.5.1-Tomcat6

Related Documentation

There are some documentation may be useful to you.

Installation

This topic describes how to install Node.js. Demos in the official documents are based on SDK 6.X. For SDKs of earlier versions, see Document for 5.X SDK.

Node.js runtime

Currently, Function Compute supports the Node.js 6.10 (runtime version 6) and Node.js 8.9.0 (runtime version 8).

Related Products

There are some products which can help you to optimize your experience on Node.js.

Function Compute

Alibaba Cloud Function Compute is an event-driven and fully-managed compute service. With Function Compute, you can quickly build any type of applications or services without considering management or O&M. You can complete a set of backend services for processing multimedia data even in several days.

Object Storage Service

An encrypted and secure cloud storage service which stores, processes and accesses massive amounts of data from anywhere in the world

Related Courses

We also have some courses to help you excel in the tools.

Operate and Manage Object Storage on the Cloud

This course explains the basic concepts of OSS. It also includes demos such as bucket management, object storage operations, image processing, website hosting and monitoring and introduces the OSS related security features.

A Demo of How to Use Function Compute HTTP Trigger

In this online course, you will learn how to configure Alibaba Cloud Function compute product using its embedded HTTP trigger, so that when request is sent to a particular URL, your predefined actions will be triggered automatically.

0 0 0
Share on

Alibaba Clouder

2,599 posts | 764 followers

You may also like

Comments