Smollbite Icon
SmollBites
Email logo

Bucket

Need some storage online for a simple or prototype project? I gotchuuu!

But first, what is Bucket?

A Bucket is like an actual bucket, wherein you can put your stuff in.

A Bucket can hold multiple images.

Bucket icon

Step 1: Create a bucket

Go to the Create Page, and this will return a bucket URL that'll use to upload image.

This is the result of the creation, the upload_url.

javascript
{
  upload_url: "https://bucket.smollbites.com/YOUR_BUCKET_ID/upload"
}

Step 2: Uploading

In uploading, use the upload_url from step 1. Create an input field

html
<input id="fileInput" type="file" />

And, now upload the file

javascript
const fileInput = document.getElementById('fileInput');
const file = fileInput.files[0];
const formData = new FormData()
formData.append('file', file);

fetch('https://bucket.smollbites.com/YOUR_BUCKET_ID/upload	', {
  method: "POST",
  body: formData
})
.then((response) => response.json())
.then((response) => {
  console.log(response);
  /**
   * {
   * 	success: true,
   * 	path: "....com/YOUR_BUCKET_ID/YOUR_IMAGE_ID.png"
   * }
   */
})

That's it, congrats!

Workflow

This is the simple workflow, I created this because, as of writing this documentation, I want to do some designing

SmollBites - Bucket Workflow

Limitations

As of now, the maximum file size is 10mb and JPG, JPEG, PNG are the only files allowed. Let's see soon if I can support intergalactic file extensions. Let's see.

Ready to create?