Ana Sayfa

Api Dokumanı

Dosya Upload Servisi API Kullanım Kılavuzu

Genel Bilgiler

Base URL

https://huseyinboyraz.com.tr/file/

Rate Limiting

Upload: 5 dosya/dakika

Download: Sınırsız

Dosya Limitleri

Maksimum dosya boyutu: 1TB

Toplam upload limiti: 1TB

Dosya sayısı: Sınırsız

Dosya Upload

POST /api.php

Yeni dosya(lar) yükler. Çoklu dosya upload desteklenir.

Parametreler:

files[] (file, required) - Yüklenecek dosya(lar)
description (string, optional) - Dosya açıklaması
expiration (string, optional) - Silinme süresi
password (string, optional) - Dosya şifresi

Silinme Süreleri:

10m - 10 dakika 30m - 30 dakika 1h - 1 saat 6h - 6 saat 12h - 12 saat 1d - 1 gün 7d - 7 gün 1M - 1 ay 1y - 1 yıl never - Asla silinmesin

Başarılı Yanıt:

{ "success": true, "id": "a1b2c3d4e5f6...", "url": "https://huseyinboyraz.com.tr/file/details/a1b2c3d4e5f6...", "download_url": "https://huseyinboyraz.com.tr/file/download/a1b2c3d4e5f6...", "expires_at": 1698765432, "expiration_type": "10m", "file_size": 1048576, "total_size": 2097152, "original_filename": "example.jpg", "file_count": 2, "has_password": false }

Hata Yanıtları:

{ "error": "No files uploaded" }
{ "error": "File too large (max 1TB)" }
{ "error": "Rate limit exceeded" }

Dosya İndirme

GET /download/{id}

Dosyayı indirir. Şifreli dosyalar için şifre gerekir.

Parametreler:

id (string, required) - Dosya ID'si
password (string, optional) - Dosya şifresi (şifreli dosyalar için)

Örnek:

GET /download/a1b2c3d4e5f6... GET /download/a1b2c3d4e5f6...?password=mypassword

Dosya Detayları

GET /details/{id}

Dosya detaylarını gösterir.

Parametreler:

id (string, required) - Dosya ID'si

API Status

GET /api.php

API durumunu kontrol eder.

Yanıt:

{ "status": "ok", "message": "File upload api çalışıyor", "version": "1.0.0", "max_file_size": "1TB", "endpoints": { "POST /api": "Yeni dosya upload", "GET /api/{id}": "Dosyayı indir", "GET /api/{id}?password=xxx": "Şifreli dosyayı indir" } }

Kullanım Örnekleri

cURL ile Dosya Upload:

curl -X POST https://huseyinboyraz.com.tr/file/api.php \ -F "files[]=@/path/to/file1.jpg" \ -F "files[]=@/path/to/file2.pdf" \ -F "description=Önemli dosyalar" \ -F "expiration=1d" \ -F "password=secret123"

JavaScript ile Upload:

const formData = new FormData(); formData.append('files[]', fileInput.files[0]); formData.append('description', 'Test dosyası'); formData.append('expiration', '1h'); formData.append('password', 'mypassword'); fetch('https://huseyinboyraz.com.tr/file/api.php', { method: 'POST', body: formData }) .then(response => response.json()) .then(data => { if (data.success) { console.log('Upload başarılı:', data.url); } else { console.error('Hata:', data.error); } });

PHP ile Upload:

$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://huseyinboyraz.com.tr/file/api.php'); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, [ 'files[]' => new CURLFile('/path/to/file.jpg'), 'description' => 'Test dosyası', 'expiration' => '1d', 'password' => 'secret' ]); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); $data = json_decode($response, true); if ($data['success']) { echo "Upload başarılı: " . $data['url']; } else { echo "Hata: " . $data['error']; } curl_close($ch);

Güvenlik

Desteklenen Dosya Türleri

• Resimler: JPEG, PNG, GIF, WebP, SVG

• Videolar: MP4, AVI, MOV, WMV

• Ses: MP3, WAV, OGG

• Dokümanlar: PDF, DOC, DOCX, XLS, XLSX, PPT, PPTX

• Metin: TXT, CSV, HTML, CSS, JS, JSON, XML

• Arşivler: ZIP, RAR

Engellenen Dosya Türleri

• PHP dosyaları (.php, .php3, .php4, .php5, .phtml)

• Executable dosyalar (.exe, .bat, .cmd, .com, .scr)

• Script dosyaları (.sh, .bash, .js, .vbs)

• Server dosyaları (.htaccess, .htpasswd)

Hata Kodları

400 Bad Request - Geçersiz parametreler veya dosya
401 Unauthorized - Şifre gerekli veya yanlış
403 Forbidden - Bot erişimi engellendi
404 Not Found - Dosya bulunamadı veya süresi dolmuş
429 Too Many Requests - Rate limit aşıldı
500 Internal Server Error - Sunucu hatası