Starfiles

File sharing done simple.

Home

API (Developer Tools)

StarfilesJS

Add StarfilesJS:

<script id="starfilesuploadscript" src="https://starfiles.ml/assets/smalljs.php?file=upload"></script>

Add Dependencies:

<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.9-1/core.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.9-1/sha256.js"></script>

Add Upload Form:

<input type="file" id="uploaded_file" onchange="uploadFile()" multiple="multiple">

Handling Outputs:

<div id="output"></div>

Progress:

<div id="progress">
    <span id="progressContainer"></span>
    <span id="remaining_size"></span>
    <span id="eta"></span>
    <span id="status"></span>
    <span id="upload_speed"></span>
</div>

Chunked File Upload

Chunks are split into chunks of up to 2MB (2097152 bytes). Repeat the following for each chunk:

Endpoint: https://starfiles.ml/api/chunkedupload

Parameters:

upload: file

number_of_chunks: chunk count

chunk_number: chunk number

The last chunk uploaded will return the file ID. Use it like so: https://starfiles.ml/file/ID

Get file information

Endpoint: https://starfiles.ml/api/file/fileinfo

Parameter:

File: ID

Method: GET

Example: https://starfiles.ml/api/file/fileinfo?file=26ae82

Example Output:

{
    "name":"face.png",
    "extension":"png",
    "mime_type":"image/png",
    "size":"654382",
    "tidy_size":"639.04KB",
    "upload_time":"1598272797",
    "time_ago" : "19 days ago",
    "download_count":"0"
}