webApp/index.php
toto 0f2f5172ac Improve image thumbnail
And auto download apk for android
2022-02-16 16:32:29 +01:00

55 lines
1.6 KiB
PHP

<?php
$ua = strtolower($_SERVER['HTTP_USER_AGENT']);
if(stripos($ua,'android') !== false): // && stripos($ua,'mobile') !== false) {
$file = "localTransfer-app.apk";
header("Content-Description: File Transfer");
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"". basename($file) ."\"");
readfile ($file);
//header("Location: ".$_SERVER['REQUEST_URI'].$file);
exit();
else:
?>
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<link href="style/style.css" rel="stylesheet">
<link rel="stylesheet" href="style/imagepreview.css"/>
<link href="/fontawesome/css/all.css" rel="stylesheet" />
<title>Local Transfer</title>
</head>
<body>
<input type="text" id="url">
<div class="transfer">
<div id="drop-area">
<form class="my-form">
<p>Upload multiple files with the file dialog or by dragging and dropping images onto the dashed region</p>
<input type="file" id="fileElem" multiple onchange="handleFiles(this.files)">
<label class="button" for="fileElem">Select some files</label>
</form>
<!--<div class="remaining">
<div class="progress" style="display: none;">
<div class="progress-bar"></div>
</div>
<div id="speed"></div>
</div>
<div id="uploadStatus"></div>-->
<div id="gallery"></div>
<div id="list"></div>
</div>
<div class="list"></div>
</div>
<div id="transProgress"></div>
<script src="js/jquery-3.5.1.min.js" type="text/javascript"></script>
<script src="js/imagepreview.js" type="text/javascript"></script>
<script src="js/script.js"></script>
</body>
</html>
<?php
endif;
?>