Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- </head>
- <body>
- <form method="post" action="<?php echo $_SERVER['PHP_SELF']?>" enctype="multipart/form-data" >
- <input type="hidden" name="MAX_FILE_SIZE" value="500000"/>
- <input type="file" name="file_gambar" />
- <br/>
- <input type="submit" name="sub" value="Submit"/>
- </form>
- </body>
- <?php
- if(isset($_POST['sub']) && $_POST['sub']=='Submit'){
- $tmp=$_FILES['file_gambar']['tmp_name'];
- $name=$_FILES['file_gambar']['name'];
- $tujuan="../upload/".$name;
- if(move_uploaded_file($tmp,$tujuan)){
- chmod($tujuan,0777);
- echo "Upload Sukses";
- }
- else{
- echo "Upload gagal";
- }
- }
- ?>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment