retorno url link subida
[imagebin.git/.git] / index.php
1 <title>Imagebin Reisub</title>
2 <style>
3 footer {
4   text-align: center;
5   padding: 3px;
6   background-color: Cadetblue;
7   color: white;
8 }
9 a {
10   outline: none;
11   text-decoration: none;
12   padding: 2px 1px 0;
13 }
14
15 a:link {
16   color: #265301;
17 }
18
19 a:visited {
20   color: #437A16;
21 }
22
23 a:focus {
24   border-bottom: 1px solid;
25   background: #BAE498;
26 }
27
28 a:hover {
29   border-bottom: 1px solid;     
30   background: #CDFEAA;
31 }
32
33 a:active {
34   background: #265301;
35   color: #CDFEAA;
36 }
37 </style>
38 <link  rel="icon"   href="https://reisub.nsupdate.info/imagebin/icon.png" type="image/png" />
39 <meta name="Author" lang="es" content="Reisub Informatica" />
40 <meta name="keywords" content="imagen, gif, png, jpg, upload, gallery, temporary, imagebin, temporal, argentina, reisub, server" />
41 <meta name="description" content="Galeria temporal, sube tu imagen y todos los 28 de cada mes se borraran del servidor." />
42 <!-- source code https://phpans.com/php-secure-image-upload/ -->
43 <!-- https://github.com/shred/phpminigallery -->
44 <center>
45 <img src="temporal_gallery.jpg" alt="temporal gallery image logo" width="500" height="300">
46 <br><br>
47 </center>
48 <?php
49 require_once "upload.class.php"; 
50 if(isset($_FILES['file'])) {
51 $origname = $_FILES['file']['name'];
52 $ext = explode(".", $origname);
53 $extension = end($ext);
54 $md5 = md5(time()).md5($origname);
55 $uplaodfile = md5($md5).'.'.$extension;
56
57 $dir = "upload";
58 if (!is_dir($dir))
59 {
60  mkdir($dir, 0755);
61 }
62 $uploader = new uploader($_FILES['file'],$dir.'/',$uplaodfile);
63 $uploader->upload();
64 $ok = $uploader->getInfo();
65 if(!empty($ok))
66 {
67 $avatar = $dir . '/' . $uplaodfile;
68 $uploaded= $uploader->getInfo();
69 uploader::e($uploaded);
70 }
71 else
72 {
73 $uploaded = $uploader->getError();
74 uploader::e($uploaded);
75
76
77 }
78 }
79 else
80 {
81 ?>
82 <form method="post" enctype="multipart/form-data">
83  Seleccionar imagen para subir:
84  <input type="file" name="file" >
85  <input type="submit" value="Subir Imagen" name="submit">
86 </form>
87
88 <?php
89 }
90 ?>
91 <br>
92 <a href="https://reisub.nsupdate.info/imagebin/index_HD.php">Subir en Full HD</a><br>
93 <br>
94 Cada 28 de cada mes se borran los archivos.<br><br>
95 <a href="https://reisub.nsupdate.info/imagebin/upload/">Ver galeria</a>
96 <br><br>
97 <footer>
98 Imagebin © 2020 Desde Junin, Buenos Aires, Argentina. Corriendo en Debian. <a href="https://reisub.nsupdate.info/reisub/">Donar a la causa.</a> - <a href="https://friendicarg.nsupdate.info/profile/fabianbonetti">Denunciar Imagen</a> - <a href="https://reisub.nsupdate.info/git/?a=project_list;pf=imagebin.git">Source Code</a>
99 </footer>