Pengenalan
File Uploader adalah layanan gratis untuk mengupload file dengan ukuran unlimited menggunakan Gofile.io sebagai backend storage.
Layanan ini sepenuhnya gratis dan dapat digunakan oleh siapa saja tanpa registrasi atau API key.
Fitur Utama
- Upload file unlimited size
- Tidak perlu registrasi atau API key
- Link download permanen
- Support semua tipe file
- HTTPS & secure
- CORS enabled untuk web apps
Endpoint API
https://upload.gofile.io/uploadfile
Parameters
| Parameter | Type | Required | Deskripsi |
|---|---|---|---|
file |
File | ā Ya | File yang akan diupload (multipart/form-data) |
folderId |
String | ā Tidak | ID folder tujuan (opsional) |
Contoh cURL
Upload file menggunakan command line dengan cURL:
curl -X POST https://upload.gofile.io/uploadfile \
-F "file=@/path/to/your/file.pdf"
Dengan Progress Bar
curl -X POST https://upload.gofile.io/uploadfile \
-F "file=@document.pdf" \
--progress-bar \
-o response.json
# Lihat hasil
cat response.json | jq '.data.downloadPage'
Contoh JavaScript
Browser (dengan fetch API)
async function uploadFile(file) {
const formData = new FormData();
formData.append('file', file);
try {
const response = await fetch('https://upload.gofile.io/uploadfile', {
method: 'POST',
body: formData
});
const data = await response.json();
if (data.status === 'ok') {
console.log('Upload berhasil!');
console.log('Download URL:', data.data.downloadPage);
console.log('File ID:', data.data.fileId);
return data.data;
} else {
throw new Error('Upload gagal');
}
} catch (error) {
console.error('Error:', error);
throw error;
}
}
// Contoh penggunaan dengan input file
document.getElementById('fileInput').addEventListener('change', async (e) => {
const file = e.target.files[0];
if (file) {
const result = await uploadFile(file);
alert('File uploaded: ' + result.downloadPage);
}
});
Node.js (dengan FormData)
const fs = require('fs');
const FormData = require('form-data');
const axios = require('axios');
async function uploadFile(filePath) {
const formData = new FormData();
formData.append('file', fs.createReadStream(filePath));
try {
const response = await axios.post(
'https://upload.gofile.io/uploadfile',
formData,
{
headers: formData.getHeaders(),
maxContentLength: Infinity,
maxBodyLength: Infinity
}
);
if (response.data.status === 'ok') {
console.log('Upload berhasil!');
console.log('Download URL:', response.data.data.downloadPage);
return response.data.data;
}
} catch (error) {
console.error('Upload error:', error.message);
throw error;
}
}
// Contoh penggunaan
uploadFile('./document.pdf')
.then(data => console.log('Success:', data))
.catch(err => console.error('Failed:', err));
Contoh Python
Menggunakan requests
import requests
def upload_file(file_path):
"""Upload file ke Gofile.io"""
url = "https://upload.gofile.io/uploadfile"
try:
with open(file_path, 'rb') as file:
files = {'file': file}
response = requests.post(url, files=files)
data = response.json()
if data['status'] == 'ok':
print('Upload berhasil!')
print(f"Download URL: {data['data']['downloadPage']}")
print(f"File ID: {data['data']['fileId']}")
return data['data']
else:
raise Exception('Upload gagal')
except Exception as e:
print(f'Error: {e}')
raise
# Contoh penggunaan
if __name__ == '__main__':
result = upload_file('document.pdf')
print(f'File tersedia di: {result["downloadPage"]}')
Dengan Progress Bar (tqdm)
import requests
from tqdm import tqdm
import os
def upload_file_with_progress(file_path):
"""Upload file dengan progress bar"""
url = "https://upload.gofile.io/uploadfile"
file_size = os.path.getsize(file_path)
with open(file_path, 'rb') as file:
with tqdm(total=file_size, unit='B', unit_scale=True,
desc='Uploading') as pbar:
def callback(monitor):
pbar.update(monitor.bytes_read - pbar.n)
from requests_toolbelt import MultipartEncoder, MultipartEncoderMonitor
encoder = MultipartEncoder(fields={'file': (
os.path.basename(file_path), file, 'application/octet-stream'
)})
monitor = MultipartEncoderMonitor(encoder, callback)
response = requests.post(
url,
data=monitor,
headers={'Content-Type': monitor.content_type}
)
data = response.json()
if data['status'] == 'ok':
print('\nā
Upload berhasil!')
print(f"š Link: {data['data']['downloadPage']}")
return data['data']
else:
raise Exception('Upload gagal')
# Install dependencies:
# pip install requests tqdm requests-toolbelt
if __name__ == '__main__':
upload_file_with_progress('large_file.zip')
Response Format
Success Response
{
"status": "ok",
"data": {
"downloadPage": "https://gofile.io/d/ABC123",
"code": "ABC123",
"parentFolder": "xyz789",
"fileId": "file123",
"fileName": "document.pdf",
"md5": "5d41402abc4b2a76b9719d911017c592"
}
}
Response Fields
| Field | Type | Deskripsi |
|---|---|---|
status |
String | Status response: "ok" atau "error" |
downloadPage |
String | URL halaman download file |
code |
String | Kode unik file/folder |
fileId |
String | ID unik file |
parentFolder |
String | ID folder parent |
fileName |
String | Nama file yang diupload |
md5 |
String | Hash MD5 file |
Error Handling
Error Response
{
"status": "error",
"error": "File too large",
"message": "Maximum file size exceeded"
}
Common Errors
| Error | Status Code | Deskripsi |
|---|---|---|
| File not provided | 400 | File tidak ditemukan dalam request |
| Network error | - | Koneksi internet bermasalah |
| Server error | 500 | Error pada server Gofile |
| Rate limit exceeded | 429 | Terlalu banyak request dalam waktu singkat |
Error Handling Example (Python)
import requests
from requests.exceptions import RequestException
def upload_with_retry(file_path, max_retries=3):
"""Upload dengan retry mechanism"""
url = "https://upload.gofile.io/uploadfile"
for attempt in range(max_retries):
try:
with open(file_path, 'rb') as file:
files = {'file': file}
response = requests.post(url, files=files, timeout=300)
response.raise_for_status()
data = response.json()
if data.get('status') == 'ok':
return data['data']
else:
print(f"Upload failed: {data.get('error', 'Unknown error')}")
except RequestException as e:
print(f"Attempt {attempt + 1} failed: {e}")
if attempt < max_retries - 1:
print("Retrying...")
continue
else:
raise
raise Exception("Max retries reached")
Batasan & Limits
Untuk menjaga kualitas layanan, ada pembatasan jumlah request. Jika terkena rate limit, tunggu beberapa saat sebelum retry.
Limits
- File Size: Unlimited
- File Types: Semua tipe file didukung
- Rate Limit: Tergantung Gofile.io policy
- Storage: File disimpan di Gofile.io
- Retention: Permanent (selama tidak dihapus)
Tips & Best Practices
1. Implement Retry Logic
Selalu gunakan retry mechanism untuk menangani network error atau temporary failures.
2. Validate File Size
Check file size di client-side sebelum upload untuk memberikan feedback lebih cepat ke user.
3. Show Progress
Tampilkan progress bar untuk upload file besar agar user tahu proses masih berjalan.
4. Handle Errors Gracefully
Berikan error message yang jelas dan actionable kepada user.
5. Save Download Links
Simpan download link hasil upload untuk referensi di kemudian hari.
6. Use HTTPS
Selalu gunakan HTTPS endpoint untuk keamanan data.
Butuh Bantuan?
Jika ada pertanyaan atau menemukan bug, silakan hubungi administrator atau buat issue di repository.
Mulai Upload Sekarang
Coba upload file pertama kamu dan dapatkan link download instant!
Mulai Upload