web-ft/front.php

51 lines
2.0 KiB
PHP

<head>
<title>VirtIT ft</title>
<link rel="stylesheet" type="text/css" href="<?php print(_HTTP_PATH . "style.css"); ?> ">
<link rel="icon" type="image/x-icon" href="<?php print(_HTTP_PATH . "favicon.ico"); ?> ">
<script src="<?php print(_HTTP_PATH . "script.js"); ?> "></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
@font-face {
font-family: 'Roboto';
src: url('<?php print(_HTTP_PATH . "Roboto-Regular.woff2"); ?>') format('woff2'),
url('<?php print(_HTTP_PATH . "Roboto-Regular.woff"); ?> ') format('woff');
font-weight: normal;
font-style: normal;
}
</style>
</head>
<body>
<div class=core>
<h1>File Transfer</h1>
<div id=dragzone class=dragndrop ondrop="file_dropped(event);" ondragover="return false" ondragenter="change_color_ondrag('ondragenter');" ondragleave="change_color_ondrag('ondragleave');" >
Drag and Drop your file or <input class="button" type="button" value="Select File" onclick="file_explorer();">
<input type="file" id="uploadfile" hidden>
<br>
<small>(Maximum <?php print(formatBytes(_SIZE_LIMIT)); ?>)</small>
<br><br><br><br>
<div id=divresponse></div><button class="button" id=copytoclipboard style="visibility: hidden;" onclick="copytoclipboard();">Copy to clipboard</button>
</div>
<div class=infobox>
This tool is usable with <b>curl</b> or <b>wget</b>.<br><br>
To upload file (max <?php print(formatBytes(_SIZE_LIMIT)); ?>): <br>
<li> curl --upload-file ./my_file <?php print($uploadurl);?><br>
<li> wget -q --body-file='./my_file' --method=PUT -O - <?php print($uploadurl);?><br><br>
To download file :<br>
<li> curl -OJ <fturl><?php print($downloadurl . '99999');?><br></fturl>
<li> wget --content-disposition <fturl><?php print($downloadurl . '99999');?></fturl>
</div>
</div>
<footer>
File transfer was created by <a href="https://twitter.com/AmazingBeu">@AmazingBeu</a>. You can find sources <a href="https://git.virtit.fr/VirtIT/web-ft">here</a>.
</footer>
</body>
</html>