Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form action="http://storageServer/upload_file.php" method="post"
- enctype="multipart/form-data">
- <label for="file">Filename:</label>
- <input type="file" name="file" id="file" />
- <br />
- <input type="submit" name="submit" value="Submit" />
- </form>
- <?php
- $folder = "files/";
- $path = $folder . basename( $_FILES['file']['name']);
- if(move_uploaded_file($_FILES['file']['tmp_name'], $path)) {
- echo "The file ". basename( $_FILES['file']['name']). " has been uploaded";
- } else{
- echo "There was an error uploading the file, please try again!";
- }
- ?>
- $ch = curl_init("http://www.remotepage.com/upload.php");
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_POST, true);
- curl_setopt($ch, CURLOPT_POSTFIELDS, array('fileupload' => '@'.$_FILES['theFile']['tmp_name']));
- echo curl_exec($ch);
Add Comment
Please, Sign In to add comment