File Service (10 posts)

Previously I wrote how to upload files to the Backendless Hosting system. Once a file is uploaded, it gets a public URL which can either be obtained using Backendless console or calculated using the following template:

Alternatively, when a file is uploaded, the API call returns the URL of the uploaded file. The sample code below demonstrates how to download the file. The code prints out the contents of the file to system console, but it can be easily modified to store it in the local file system, or transfer elsewhere over the network, etc:
Continue reading

Any file in the Backendless File storage is also accessible through a public URL. This functionality can be restricted by changing security settings. Public file URL can be built using the following format:

where <application id>   <path> and  <filename> should be replaced with the specific values. Another way to obtain file’s public URL is by using Backendless console:
Continue reading

Directories in the file storage can be created implicitly as a result of uploading files using the File Service API. Alternatively, a directory can be created using Backendless console. To do that:

  1. Login to Backendless console, select your app and click he Files icon.
  2. Navigate to a directory where a new directory should be created (or just stay in the root one).
  3. Click the New Folder button.
  4. Enter the name of the directory in the popup and click the Save button.
  5. The directory is created and can be used right away in console as well as the APIs.

new directory button - Feature 67: Creating directories in Backendless File Storage

Backendless is not just a mobile backend – it also provides hosting and runtime support for browser-based applications. Indeed, we offer a fully-featured SDK for JavaScript apps. Unless you host your Backendless-powered app in our Hosting system, you will be running into cross-origin domain requests. This occurs when an application is loaded into a browser from one host, but then it makes a request (XHR, socket, etc) to another host. In the case of Backendless, the second host would be the backend platform we provide.

Continue reading

Previously I described how to upload files to Backendless file storage using File Service API. In addition to the file upload API, Backendless console supports online (built into the console) text editor. The editor lets you create new files with just a click of a button:

  1. Login to Backendless console, select your app and click the Files icon.
  2. Browse to a directory where the file should be created and click the New File button from the toolbar.
  3. Enter the name of the file and select a syntax highlighter.
  4. As you edit the file, the editor can also highlight syntax errors for most document types:creating new files in backendless - Feature 46: Creating new files in file storage using console's online text editor
  5. Click Save to save the file. It immediately becomes available for download.

In one of my previous posts I wrote about Backendless File Browser – an online management for your files and directories. One of the features built into File Browser is the ZIP Directory feature. The feature does exactly what it sounds like it would do – creating a zip file for a directory and its contents. At any level of your directory hierarchy, you can click the ZIP Directory button and Backendless creates a zip file with the name of the directory. The file is created at the same level in the hierarchy as the directory which is being zipped.
zip directory button - Feature 41: Compress any directory in your Backendless file storage using console

Backendless file storage includes a very powerful (and quite convenient) integration with git. There are many features which come with that integration and I will be describing them in detail in future posts. Here’s a brief list of what you can do with it:

  • Work with your file storage as with a fully-functional GIT repository.
  • Upload files to Backendless via API or with the Backendless Console and they are automatically added to the repository.
  • Add/commit files via GIT and they are automatically copied to the “browseable” file storage. These files become accessible via Backendless download API, and the web server function.
    Continue reading

Backendless File storage can be used to host web applications. The file storage includes a special directory – “/web” which is used to host web application content. Since the default URLs for files in your file storage are rather long and use the domain, it may be desirable to map a custom domain name to your Backendless backend and specifically the file storage. Note that at the time of writing of this post, this feature is available for the applications in the Backendless Plus pricing plan, but that may change in the future.

Continue reading
There are several way to upload file content to the server:
  1. A traditional approach where a physical file from the client environment is uploaded using the API.
  2. Creating a remote file with content generated on the client side.
In this article I will review the first option – uploading a file with the API.
Once a file is uploaded, the File Service enables the following:
  • You can see the file in File Browser in Backendless console.
  • File can be downloaded via a URL assigned to it. The URL is composed as:
  • Application developer can assign permissions to control who (users or roles) can download or delete the file.
  • If git integration is enabled for the application, the file is also committed to the repository.
    Continue reading
Every Backendless backend includes a file storage space which can be used by your application or can host your web application. The space is managed by the Backendless File Service which is a core element of the Backendless Platform. The service provides APIs for file upload/download and deletion, manages files/directories permissions and handles git integration. Backendless console includes a powerful visual tool for file storage management – File Browser conveniently available behind the Files icon.
Continue reading