The automating of file upload has brought some changes that affect how users upload their files. Much is discussed about client-side vs server-side uploading, given that automated file uploading software and plugins are typically server-side. In this article, we aim to explain which option is best.

Automatic File Upload

These days, websites require constantly updating their information to remain relevant and engaging to visitors. For web administrators that means uploading an ever-increasing amount of content files. Therefore, the task sometimes becomes overwhelming. More websites then, upload their content using automatic file uploading, a tool that uses code to upload new files to a site without the user intervention.

These solutions come in the form of web widgets, plugins or complete solutions. Let’s review a few features you should look when choosing tools for automating your uploads. There are several solutions around, some open-source, some enterprise level.

The best file uploading software, however, should have the following characteristics:

  • Processes different types of uploads—simple, multipart and resumable.
  • Supports multiple coding languages—such as HTML, JavaScript, and PHP.
  • Uploads directly to a server—without involving a third-party browser
  • Supports uploading multiple files—working with many different libraries for file uploading, or multiple file uploads from a single source.
  • Has a progress bar—to track the uploading of the file

This approach helps administrators and web developers to upload multiple files at a time and schedule uploads, ultimately keeping the website updated. That being said, out of security concerns, all automatic file upload solutions control the uploading from the server-side. So, which method is best? Let’s start by reviewing the basics of the client-server model.

Client-Server Model

Most of the web is based on this model, in which user devices connect via a network with centrally located servers to get the data they need, instead of communicating with each other. Thus, endpoint devices such as laptops, smartphones, and computers are the clients of the servers, sending requests to them. The reason behind the client-server model is that servers are more powerful and can serve multiple client devices at one, which in turn send requests to multiple server while browsing the web.

What Is the Dilemma of Client-Side vs Server-Side?

Client-side means that the action is done on the user’s device, while the server-side means that the action takes place on the webserver. This difference is important for file upload, as it is widespread nowadays on websites such as social media, blogs and forums, where users (the client side) upload their content straight to the website.

Another aspect to take into consideration is how different programming languages adapt to work without a web server. Take, for example, JavaScript. This language allows accomplishing most tasks without requiring access to a web server. On the other hand, languages such as Ruby, PHP, and Python, require access to a server that supports the language to accomplish tasks.

That means that tasks accomplished with those languages happen on the server-side. An example of a use case that is usually handled server-side is data storage. If data was stored client-side, banks and health services would have to keep records of millions of user databases all over the world. Instead, they keep all the user data in a central database where they and the user have access.

Thus, these terms define where an operation is happening, on the server or on the client?

Client-side actions

Let’s take, for example, Instagram. This application downloads images of people you follow from the server and displays them to you. It also lets you upload pictures, sending them to the server. One of the most famous features of Instagram is the filter, by which you can enhance the picture before sending it to the server. This enhancing happens in the user’s smartphone, therefore is a client-side operation. The widespread usage of endpoint devices such as smartphones, tablets, and laptops have become more powerful, they require more client-side applications.

Server-side actions

As we explained above, the most common example of server-side operations is data storage and retrieval. Following the Instagram example, when people sign up and upload a picture, Instagram’s server saves all the information to a database. When you look up a profile, the application sends a search query to the server, which then searches and provides you with the information of the profiles you follow.

With the increasing amount of data circulating around the web these days, it is important to manage the massive amount of data with both client-side and server-side operations in a way that benefits the user. While many developers still write their own code for file uploading forms, many organizations are using open source and enterprise-level software uploaders, to automate and speed the uploading of multiple files, and enable smooth client-side uploads.

Use Cases

Some use cases when it is a dilemma to make an action on the client or the server-side include:

Resizing images

Imagine that you are uploading a large number of images to a server, what makes more sense: to resize the image before sending them or after receiving them? Since the server can have several users uploading images at the same time, it should be more logical to resize the images on the client-side so as not to load the server. However, if the server can handle a large workload and many conversions at once, it makes sense to do it on the server.

Uploading to AWS S3
When uploading a large size to S3 is it better to upload it from the client-side or server-side? On one hand, sending it to the server-side and process can be too heavy for the bandwidth among other considerations such as:

  • Cost—while inbound traffic to the server is free, outbound from the server will accrue charges.
  • Performance—will depend on the type and size of the instance.
  • Reliability—the server needs a reliable code to transfer the files to S3.

On the other hand, uploading from client-side presents other challenges such as:

  • Security—when you provide access rights to the users to upload to S3 you should do it by using signed URLs.
  • Cost—inbound from the client to S3 is free.
  • Performance—will be limited to the performance of the user’s Internet connection.
  • Reliability—there are a number of file upload libraries available for uploading to S3, it makes sense to choose one that handles Internet interruptions and other issues.

The Bottom Line

No matter what you choose, you will probably still need to write some code for both the server and the client side. However, choosing a good quality software upload solution, you can reduce issues, such as cost, performance, and effort, and speed up your uploads.