Guest User

Untitled

a guest
Apr 20th, 2018
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. <form action="http://storageServer/upload_file.php" method="post"
  2. enctype="multipart/form-data">
  3. <label for="file">Filename:</label>
  4. <input type="file" name="file" id="file" />
  5. <br />
  6. <input type="submit" name="submit" value="Submit" />
  7. </form>
  8.  
  9. <?php
  10. $folder = "files/";
  11. $path = $folder . basename( $_FILES['file']['name']);
  12. if(move_uploaded_file($_FILES['file']['tmp_name'], $path)) {
  13. echo "The file ". basename( $_FILES['file']['name']). " has been uploaded";
  14. } else{
  15. echo "There was an error uploading the file, please try again!";
  16. }
  17. ?>
  18.  
  19. $ch = curl_init("http://www.remotepage.com/upload.php");
  20. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  21. curl_setopt($ch, CURLOPT_POST, true);
  22. curl_setopt($ch, CURLOPT_POSTFIELDS, array('fileupload' => '@'.$_FILES['theFile']['tmp_name']));
  23. echo curl_exec($ch);
Add Comment
Please, Sign In to add comment