initial commit
This commit is contained in:
commit
b65642cd0a
18 changed files with 1543 additions and 0 deletions
29
modules/quickupload/quickupload.php
Normal file
29
modules/quickupload/quickupload.php
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
$path = __DIR__ . '/../../tmp/quickupload';
|
||||
|
||||
if (!file_exists($path)) {
|
||||
mkdir($path);
|
||||
}
|
||||
$path = realpath($path);
|
||||
|
||||
function slugify($string){
|
||||
return strtolower(trim(preg_replace('/[^.A-Za-z0-9-]+/', '-', $string), '-'));
|
||||
}
|
||||
|
||||
if (isset($_FILES['file'])) {
|
||||
$f = $_FILES['file'];
|
||||
copy($f['tmp_name'], $path . '/' . uniqid() . '_' . slugify($f['name']));
|
||||
?>
|
||||
<div style="padding: 20px; border: 1px solid green; background: green; color: white">
|
||||
File uploaded!
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<h3>QuickUpload</h3>
|
||||
<form enctype="multipart/form-data" method="POST">
|
||||
<input type="hidden" name="name" value="wow" />
|
||||
<input type="file" name="file" />
|
||||
<input type="submit" value="Submit">
|
||||
</form>
|
||||
Loading…
Add table
Add a link
Reference in a new issue