```php
<?php
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['file'])) {
$file = $_FILES['file'];
$url = file_get_contents('https://b.baipiao.wiki/link');
// 已反代,源站https://video-oss.vercel.app/link
$file_content = file_get_contents($file['tmp_name']);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_POSTFIELDS, $file_content);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: image/jpeg'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
if($file['type'] === "image/jpeg"){
$upload_url = $url;
}else{
$upload_url = $url . '?response-content-type=' . $file['type'];
}
if (strpos($upload_url, 'https://plat-sh-community-prod-upload-ugc.oss-cn-shanghai.aliyuncs.com/') !== false) {
$upload_url = str_replace('https://plat-sh-community-prod-upload-ugc.oss-cn-shanghai.aliyuncs.com/', 'https://upload-bbs.miyoushe.com/', $upload_url);
}
echo json_encode(['upload_url' => htmlspecialchars($upload_url)]);
exit;
}elseif(isset($_GET['down'])){
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="index.php"');
header('Content-Transfer-Encoding: binary');
readfile('index.php');
}
?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.3.3/css/bootstrap.min.css">
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<title>文件上传</title>
<style>
html, body {
height: 100%;
margin: 0;
overflow: hidden;
}
.container {
height: 100%;
}
.button-group {
gap: 10px;
}
</style>
</head>
<body>
<div class="container d-flex justify-content-center align-items-center">
<div class="card" style="width: 30rem;">
<div class="card-body">
<h5 class="card-title text-center">望各位老板请把珍藏的.avi上传</h5>
<form id="uploadForm" enctype="multipart/form-data">
<div class="mb-3">
<label for="file" class="form-label">选择文件</label>
<input type="file" class="form-control" id="file" name="file" required>
</div>
<button type="submit" class="btn btn-primary w-100">上传</button>
</form>
<div id="uploadStatus" class="mt-3" style="display:none;">
<div class="progress" style="height: 25px;">
<div id="progressBar" class="progress-bar progress-bar-striped" role="progressbar" style="width: 0%;" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">正在上传中... 0%</div>
</div>
</div>
<div id="uploadLink" class="mt-3" style="display:none;">
<p>文件链接:</p>
<input type="text" id="link" class="form-control" readonly>
<div class="d-flex button-group mt-2">
<button id="copyButton" class="btn btn-success w-75">复制链接</button>
<button id="shareButton" class="btn btn-warning w-25">分享</button>
</div>
</div>
<br>
<a href="?down">源码在这里下载嘞~~~!</a>
</div>
</div>
</div>
<script>
$(document).ready(function() {
$('#uploadForm').on('submit', function(event) {
event.preventDefault();
// Reset the progress bar and link when starting a new upload
$('#uploadStatus').hide();
$('#progressBar').css('width', '0%').attr('aria-valuenow', 0).text('正在上传中... 0%');
$('#link').val(''); // Reset the link input
$('#uploadLink').hide(); // Hide the upload link section
$('#uploadStatus').show();
var formData = new FormData(this);
var xhr = new XMLHttpRequest();
xhr.upload.addEventListener("progress", function(evt) {
if (evt.lengthComputable) {
var percentComplete = Math.round((evt.loaded / evt.total) * 100);
$('#progressBar').css('width', percentComplete + '%').attr('aria-valuenow', percentComplete).text('正在上传中... ' + percentComplete + '%'); // 更新文本内容
}
}, false);
xhr.onreadystatechange = function() {
if (xhr.readyState === XMLHttpRequest.DONE) {
if (xhr.status === 200) {
$('#progressBar').css('width', '100%').attr('aria-valuenow', 100).text('上传完成 100%');
var result = JSON.parse(xhr.responseText);
if (result.upload_url) {
$('#link').val(result.upload_url);
$('#uploadLink').show(); // Show the upload link section
} else {
alert('上传失败,错误信息: ' + xhr.responseText);
}
} else {
alert('上传失败,错误信息: ' + xhr.statusText);
}
}
};
xhr.open("POST", '', true);
xhr.send(formData);
});
$('#copyButton').on('click', function() {
var copyText = document.getElementById("link");
copyText.select();
document.execCommand("copy");
alert("链接已复制");
});
$('#shareButton').on('click', function() {
var shareText = document.getElementById("link").value;
if (navigator.share) {
navigator.share({
title: '分享链接',
url: shareText
}).then(() => {
console.log('分享成功');
}).catch((error) => {
console.error('分享失败', error);
});
} else {
alert("您的设备不支持分享功能。");
}
});
});
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.3.3/css/bootstrap.min.css">
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<title>文件上传</title>
<style>
html, body {
height: 100%;
margin: 0;
overflow: hidden;
}
.container {
height: 100%;
}
.button-group {
gap: 10px;
}
</style>
</head>
<body>
<div class="container d-flex justify-content-center align-items-center">
<div class="card" style="width: 30rem;">
<div class="card-body">
<h5 class="card-title text-center">文件上传</h5>
<form id="uploadForm" enctype="multipart/form-data">
<div class="mb-3">
<label for="file" class="form-label">选择文件</label>
<input type="file" class="form-control" id="file" name="file" required>
</div>
<button type="submit" class="btn btn-primary w-100">上传</button>
</form>
<div id="uploadStatus" class="mt-3" style="display:none;">
<div class="progress" style="height: 25px;">
<div id="progressBar" class="progress-bar progress-bar-striped" role="progressbar" style="width: 0%;" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">正在上传中... 0%</div>
</div>
</div>
<div id="uploadLink" class="mt-3" style="display:none;">
<p>文件链接:</p>
<input type="text" id="link" class="form-control" readonly>
<div class="d-flex button-group mt-2">
<button id="copyButton" class="btn btn-success w-75">复制链接</button>
<button id="shareButton" class="btn btn-warning w-25">分享</button>
</div>
</div>
<br>
<a href="?down">源码在这里下载嘞~~~</a>
</div>
</div>
</div>
<script>
$(document).ready(function() {
$('#uploadForm').on('submit', function(event) {
event.preventDefault();
// Reset the progress bar and link when starting a new upload
$('#uploadStatus').hide();
$('#progressBar').css('width', '0%').attr('aria-valuenow', 0).text('正在上传中... 0%');
$('#link').val(''); // Reset the link input
$('#uploadLink').hide(); // Hide the upload link section
$('#uploadStatus').show();
var formData = new FormData(this);
var xhr = new XMLHttpRequest();
xhr.upload.addEventListener("progress", function(evt) {
if (evt.lengthComputable) {
var percentComplete = Math.round((evt.loaded / evt.total) * 100);
$('#progressBar').css('width', percentComplete + '%').attr('aria-valuenow', percentComplete).text('正在上传中... ' + percentComplete + '%'); // 更新文本内容
}
}, false);
xhr.onreadystatechange = function() {
if (xhr.readyState === XMLHttpRequest.DONE) {
if (xhr.status === 200) {
$('#progressBar').css('width', '100%').attr('aria-valuenow', 100).text('上传完成 100%');
var result = JSON.parse(xhr.responseText);
if (result.upload_url) {
$('#link').val(result.upload_url);
$('#uploadLink').show(); // Show the upload link section
} else {
alert('上传失败,错误信息: ' + xhr.responseText);
}
} else {
alert('上传失败,错误信息: ' + xhr.statusText);
}
}
};
xhr.open("POST", '', true);
xhr.send(formData);
});
$('#copyButton').on('click', function() {
var copyText = document.getElementById("link");
copyText.select();
document.execCommand("copy");
alert("链接已复制");
});
$('#shareButton').on('click', function() {
var shareText = document.getElementById("link").value;
if (navigator.share) {
navigator.share({
title: '分享链接',
url: shareText
}).then(() => {
console.log('分享成功');
}).catch((error) => {
console.error('分享失败', error);
});
} else {
alert("您的设备不支持分享功能。");
}
});
});
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.3.3/css/bootstrap.min.css">
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<title>文件上传</title>
<style>
html, body {
height: 100%;
margin: 0;
overflow: hidden;
}
.container {
height: 100%;
}
.button-group {
gap: 10px;
}
</style>
</head>
<body>
<div class="container d-flex justify-content-center align-items-center">
<div class="card" style="width: 30rem;">
<div class="card-body">
<h5 class="card-title text-center">望各位老板请把珍藏的.avi上传</h5>
<form id="uploadForm" enctype="multipart/form-data">
<div class="mb-3">
<label for="file" class="form-label">选择文件</label>
<input type="file" class="form-control" id="file" name="file" required>
</div>
<button type="submit" class="btn btn-primary w-100">上传</button>
</form>
<div id="uploadStatus" class="mt-3" style="display:none;">
<div class="progress" style="height: 25px;">
<div id="progressBar" class="progress-bar progress-bar-striped" role="progressbar" style="width: 0%;" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">正在上传中... 0%</div>
</div>
</div>
<div id="uploadLink" class="mt-3" style="display:none;">
<p>文件链接:</p>
<input type="text" id="link" class="form-control" readonly>
<div class="d-flex button-group mt-2">
<button id="copyButton" class="btn btn-success w-75">复制链接</button>
<button id="shareButton" class="btn btn-warning w-25">分享</button>
</div>
</div>
<br>
<a href="?down">源码在这里下载嘞~~~!</a>
</div>
</div>
</div>
<script>
$(document).ready(function() {
$('#uploadForm').on('submit', function(event) {
event.preventDefault();
// Reset the progress bar and link when starting a new upload
$('#uploadStatus').hide();
$('#progressBar').css('width', '0%').attr('aria-valuenow', 0).text('正在上传中... 0%');
$('#link').val(''); // Reset the link input
$('#uploadLink').hide(); // Hide the upload link section
$('#uploadStatus').show();
var formData = new FormData(this);
var xhr = new XMLHttpRequest();
xhr.upload.addEventListener("progress", function(evt) {
if (evt.lengthComputable) {
var percentComplete = Math.round((evt.loaded / evt.total) * 100);
$('#progressBar').css('width', percentComplete + '%').attr('aria-valuenow', percentComplete).text('正在上传中... ' + percentComplete + '%'); // 更新文本内容
}
}, false);
xhr.onreadystatechange = function() {
if (xhr.readyState === XMLHttpRequest.DONE) {
if (xhr.status === 200) {
$('#progressBar').css('width', '100%').attr('aria-valuenow', 100).text('上传完成 100%');
var result = JSON.parse(xhr.responseText);
if (result.upload_url) {
$('#link').val(result.upload_url);
$('#uploadLink').show(); // Show the upload link section
} else {
alert('上传失败,错误信息: ' + xhr.responseText);
}
} else {
alert('上传失败,错误信息: ' + xhr.statusText);
}
}
};
xhr.open("POST", '', true);
xhr.send(formData);
});
$('#copyButton').on('click', function() {
var copyText = document.getElementById("link");
copyText.select();
document.execCommand("copy");
alert("链接已复制");
});
$('#shareButton').on('click', function() {
var shareText = document.getElementById("link").value;
if (navigator.share) {
navigator.share({
title: '分享链接',
url: shareText
}).then(() => {
console.log('分享成功');
}).catch((error) => {
console.error('分享失败', error);
});
} else {
alert("您的设备不支持分享功能。");
}
});
});
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.3.3/css/bootstrap.min.css">
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<title>文件上传</title>
<style>
html, body {
height: 100%;
margin: 0;
overflow: hidden;
}
.container {
height: 100%;
}
.button-group {
gap: 10px;
}
</style>
</head>
<body>
<div class="container d-flex justify-content-center align-items-center">
<div class="card" style="width: 30rem;">
<div class="card-body">
<h5 class="card-title text-center">文件上传</h5>
<form id="uploadForm" enctype="multipart/form-data">
<div class="mb-3">
<label for="file" class="form-label">选择文件</label>
<input type="file" class="form-control" id="file" name="file" required>
</div>
<button type="submit" class="btn btn-primary w-100">上传</button>
</form>
<div id="uploadStatus" class="mt-3" style="display:none;">
<div class="progress" style="height: 25px;">
<div id="progressBar" class="progress-bar progress-bar-striped" role="progressbar" style="width: 0%;" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">正在上传中... 0%</div>
</div>
</div>
<div id="uploadLink" class="mt-3" style="display:none;">
<p>文件链接:</p>
<input type="text" id="link" class="form-control" readonly>
<div class="d-flex button-group mt-2">
<button id="copyButton" class="btn btn-success w-75">复制链接</button>
<button id="shareButton" class="btn btn-warning w-25">分享</button>
</div>
</div>
<br>
<a href="?down">源码在这里下载嘞~~~</a>
</div>
</div>
</div>
<script>
$(document).ready(function() {
$('#uploadForm').on('submit', function(event) {
event.preventDefault();
// Reset the progress bar and link when starting a new upload
$('#uploadStatus').hide();
$('#progressBar').css('width', '0%').attr('aria-valuenow', 0).text('正在上传中... 0%');
$('#link').val(''); // Reset the link input
$('#uploadLink').hide(); // Hide the upload link section
$('#uploadStatus').show();
var formData = new FormData(this);
var xhr = new XMLHttpRequest();
xhr.upload.addEventListener("progress", function(evt) {
if (evt.lengthComputable) {
var percentComplete = Math.round((evt.loaded / evt.total) * 100);
$('#progressBar').css('width', percentComplete + '%').attr('aria-valuenow', percentComplete).text('正在上传中... ' + percentComplete + '%'); // 更新文本内容
}
}, false);
xhr.onreadystatechange = function() {
if (xhr.readyState === XMLHttpRequest.DONE) {
if (xhr.status === 200) {
$('#progressBar').css('width', '100%').attr('aria-valuenow', 100).text('上传完成 100%');
var result = JSON.parse(xhr.responseText);
if (result.upload_url) {
$('#link').val(result.upload_url);
$('#uploadLink').show(); // Show the upload link section
} else {
alert('上传失败,错误信息: ' + xhr.responseText);
}
} else {
alert('上传失败,错误信息: ' + xhr.statusText);
}
}
};
xhr.open("POST", '', true);
xhr.send(formData);
});
$('#copyButton').on('click', function() {
var copyText = document.getElementById("link");
copyText.select();
document.execCommand("copy");
alert("链接已复制");
});
$('#shareButton').on('click', function() {
var shareText = document.getElementById("link").value;
if (navigator.share) {
navigator.share({
title: '分享链接',
url: shareText
}).then(() => {
console.log('分享成功');
}).catch((error) => {
console.error('分享失败', error);
});
} else {
alert("您的设备不支持分享功能。");
}
});
});
</script>
</body>
</html>
```