Убрали неиспользуемый uploads.
This commit is contained in:
parent
14ed72c021
commit
4bc8099734
@ -1,27 +0,0 @@
|
||||
<?php
|
||||
session_start();
|
||||
if(!isset($_SESSION['uid'])) { $err = 1; }
|
||||
if($_SESSION['uid'] != 10022) { $err = 2; }
|
||||
|
||||
$valid_extensions = array('jpeg', 'jpg', 'png', 'gif', 'bmp');
|
||||
$path = 'uploads/';
|
||||
|
||||
if(isset($_FILES['image']) && !$err) {
|
||||
$img = $_FILES['image']['name'];
|
||||
$tmp = $_FILES['image']['tmp_name'];
|
||||
$ext = strtolower(pathinfo($img, PATHINFO_EXTENSION));
|
||||
|
||||
if(in_array($ext, $valid_extensions)) {
|
||||
$path = $path.strtolower($img);
|
||||
if(move_uploaded_file($tmp, $path)) {
|
||||
echo "<img src='$path' title='$img' />";
|
||||
}
|
||||
} else {
|
||||
echo 'invalid';
|
||||
}
|
||||
} elseif($err == 1) {
|
||||
echo 'noUser';
|
||||
} elseif($err == 2) {
|
||||
echo 'noAcces';
|
||||
}
|
||||
?>
|
@ -1,22 +0,0 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head lang="en">
|
||||
<meta charset="utf-8" />
|
||||
<title>Загрузка</title>
|
||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
||||
<script type="text/javascript" src="js/jquery-1.11.3-jquery.min.js"></script>
|
||||
<script type="text/javascript" src="js/script.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>Загрузка изображений</h1><hr />
|
||||
<div id="preview"><img src="no-image.jpg" /></div>
|
||||
<form id="form" action="ajaxupload.php" method="post" enctype="multipart/form-data">
|
||||
<input id="uploadImage" type="file" accept="image/*" name="image" />
|
||||
<input id="button" type="submit" value="Загрузить" />
|
||||
</form>
|
||||
<div id="err"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
6
upload/js/jquery-1.11.3-jquery.min.js
vendored
6
upload/js/jquery-1.11.3-jquery.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,32 +0,0 @@
|
||||
$(document).ready(function (e) {
|
||||
$("#form").on('submit', (function(e) {
|
||||
e.preventDefault();
|
||||
$.ajax({
|
||||
url: "ajaxupload.php",
|
||||
type: "POST",
|
||||
data: new FormData(this),
|
||||
contentType: false,
|
||||
cache: false,
|
||||
processData:false,
|
||||
beforeSend : function() {
|
||||
$("#err").fadeOut();
|
||||
},
|
||||
success: function(data) {
|
||||
if(data == 'invalid') {
|
||||
$("#err").html("Файл с таким расширением запрещенно загружать").fadeIn();
|
||||
} else if(data == 'noUser') {
|
||||
$("#err").html("Вам запрещенно загружать файлы").fadeIn();
|
||||
} else if(data == 'noAcces') {
|
||||
$("#err").html("Вам запрещенно загружать файлы").fadeIn();
|
||||
} else {
|
||||
$("#preview").html(data).fadeIn();
|
||||
$("#form")[0].reset();
|
||||
$("#err").html("Файл загружен").fadeIn();
|
||||
}
|
||||
},
|
||||
error: function(e) {
|
||||
$("#err").html(e).fadeIn();
|
||||
}
|
||||
});
|
||||
}));
|
||||
});
|
Binary file not shown.
Before Width: | Height: | Size: 5.9 KiB |
@ -1,62 +0,0 @@
|
||||
@charset "utf-8";
|
||||
|
||||
body {
|
||||
background: #E7EDEE;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-family: Georgia, "Times New Roman", Times, serif;
|
||||
font-size: 170%;
|
||||
color: #645348;
|
||||
font-weight: 100;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.container {
|
||||
width: 700px;
|
||||
margin: 10px auto;
|
||||
padding: 10px 15px;
|
||||
background: white;
|
||||
border: 2px solid #DBDBDB;
|
||||
-webkit-border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#preview {
|
||||
margin-top:30px;
|
||||
}
|
||||
|
||||
#err {
|
||||
color: red;
|
||||
}
|
||||
|
||||
#preview img {
|
||||
max-width: 100%;
|
||||
border: solid #cdcdcd 1px;
|
||||
padding:5px;
|
||||
border-radius: 3px;
|
||||
-webkit-box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, .2);
|
||||
box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, .2);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
input[type="submit"] {
|
||||
border-radius: 10px;
|
||||
background-color: #00A2D1;
|
||||
border: 0;
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
padding: 6px 15px 5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#form {
|
||||
margin-top: 30px;
|
||||
margin-bottom:30px;
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 1.6 KiB |
Loading…
Reference in New Issue
Block a user