Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_POST['btnsubmit'])) {
- $tmp_name = $_FILES["imagefile"]["tmp_name"];
- if(move_uploaded_file($tmp_name, "../path/to/file.png")) {
- $file = "../path/to/file.png";
- $permissions = 0777;
- if (!chmod($file,$permissions)) {
- die('Error with CHMOD' );
- }
- } else {
- die("There was an error uploading the file, please try again");
- }
- }
- ?>
- <form method="POST" enctype="multipart/form-data" id="imgsubmission" name="imgsubmission">
- <input type="file" id="imagefile" name="imagefile" size="50"/>
- <input type="submit" name="btnsubmit" value="Submit"/>
- </form>
Advertisement
Add Comment
Please, Sign In to add comment