Fromsmash

Fromsmash

Cloud Storage & File Sharing

Fromsmash provides a powerful API and SDK that enables developers to easily upload and transfer large files. Whether you need to send large video files, images, or documents, Fromsmash's tools make it simple to get your data where it needs to go. Their platform is designed for speed and reliability, ensuring that your files are always delivered quickly and securely. With Fromsmash, you can customize your file transfer experience to meet your unique needs, whether you're building a file-sharing app or a cloud storage solution. So why not discover the power of Fromsmash's API and SDK today, and start transferring your big files with ease?

Visit API

📚 Documentation & Examples

Everything you need to integrate with Fromsmash

🚀 Quick Start Examples

Fromsmash Javascript Examplejavascript
// Fromsmash API Example
const response = await fetch('https://api.fromsmash.com/', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/json'
    }
});

const data = await response.json();
console.log(data);

Fromsmash Public API Docs

Fromsmash is a file-sharing service that allows users to easily share large files with others. The Fromsmash public API provides developers with a way to programmatically interact with the service, enabling them to integrate file-sharing capabilities into their applications. In this blog post, we'll explore the Fromsmash public API docs and provide some example code in JavaScript.

Example API Requests

Before we dive into the code, let's take a quick look at some example API requests. All Fromsmash API requests are sent via HTTPS to https://api.fromsmash.com/. Here are a few example requests:

Upload a File

To upload a file to Fromsmash, you must first generate a unique URL using the /upload_url endpoint. Then, you can use the provided URL to upload your file. Here's an example:

const fetch = require('node-fetch');
const fs = require('fs');

const filepath = '/path/to/my/file.pdf';
const filename = 'file.pdf';

fetch('https://api.fromsmash.com/upload_url', {
  method: 'POST',
  body: JSON.stringify({ name: filename })
})
  .then(response => response.json())
  .then(data => {
    const upload_url = data.upload_url;
    const file = fs.createReadStream(filepath);

    fetch(upload_url, {
      method: 'PUT',
      body: file
    });
  });

List Files

To list all files uploaded to your Fromsmash account, use the /files endpoint. Here's an example:

const fetch = require('node-fetch');

fetch('https://api.fromsmash.com/files')
  .then(response => response.json())
  .then(data => console.log(data));

Download a File

To download a file from Fromsmash, use the /download endpoint. Here's an example:

const fetch = require('node-fetch');

const file_id = 'abc123';

fetch(`https://api.fromsmash.com/download/${file_id}`)
  .then(response => {
    if (response.ok) {
      const filename = response.headers.get('content-disposition').split('=')[1];
      const file = fs.createWriteStream(`/path/to/my/downloads/${filename}`);
      response.body.pipe(file);
    } else {
      console.log(`Error downloading file with id ${file_id}`);
    }
  });

Conclusion

In this blog post, we've explored the Fromsmash public API docs and provided some example code in JavaScript. With these tools, developers can easily integrate file-sharing capabilities into their applications and provide their users with a seamless file-sharing experience.

📊 30-Day Uptime History

Daily uptime tracking showing online vs offline minutes

Jun 12Jun 14Jun 16Jun 18Jun 20Jun 22Jun 24Jun 26Jun 28Jun 30Jul 2Jul 4Jul 6Jul 8Jul 1104008001440Minutes
Online
Offline

Related APIs in Cloud Storage & File Sharing