• 0

Remote File upload script [PHP]


Question

7 answers to this question

Recommended Posts

  • 0

<?php

// Initialise variables
$remoteUrl = "https://www.neowin.net/neologo.gif";
$localPath = "images/myneologo.gif";

// Read remote file into a string
$remoteFile = implode(file($remoteUrl),"");

// Write that string to a file
$filePointer = @fopen($localPath,"w");
fwrite($filePointer,$remoteFile);
fclose($filePointer);

?>

It might not work because I haven't actually tested that code together but it should... and it could with a little work if it doesn't already :)

  • 0

Thanks, I tried that, but I got this

Warning: fwrite(): supplied argument is not a valid stream resource in /home/evilpig/public_html/host/include.php on line 12

Warning: fclose(): supplied argument is not a valid stream resource in /home/evilpig/public_html/host/include.php on line 13

I also changed it to be run by a form,

$remoteUrl = $_POST['file'];
$localPath = $_POST['this'];

EDIT: I was also referred to this

http://www.phpclasses.org/browse/package/2221.html

Maybe if you also looked there that could also help you help me. :p

(I am a php noob by the way, sort of)

Edited by evilpig
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • I've had similar thoughts about the 2TB one. The price came down to a more tempting level a few months ago, but juggling installs with a far cheaper USB SSD hasn't been so bad. Even big games rip around pretty quick when you can push them at 4gbps, and that drive can be repurposed when its time with the Xbox is done. I'd need an iron-clad promise that it'll be 100% feature complete, next-gen compatible to even consider a 4TB unit.
    • It's not. It's a rightwing lie peddled by liars to BillyBob'sFreedumb email chain. Feel free to provide any credible source to support this claim. You won't find a single one. The reason Biden wasn't prosecuted was because it was a handful of documents from the Obama years that were just in storage. And when the FBI asked for them, Biden and his team did everything they could to find them and return them immediately -- even ones the FBI didn't know were "missing". https://en.wikipedia.org/wiki/...assified_documents_incident Whereas the Charlatan in Chief stored mountains of classified material out in the open in his pay to play club infested with foreign spies. https://www.pbs.org/newshour/p...-mar-a-lago-shower-ballroom Trump also revealed this nation's most classified information to foreigners who had no clearance to access them...and then bragged about knowing them to their friends overseas. https://www.nbcnews.com/politi...arines-according-rcna119173 And not only are many still missing and not returned... https://www.cnn.com/interactiv...ssia-intelligence-trump-dg/ Trump denied having them to the FBI repeatedly and moved them around to avoid having to return them to the proper authorities for over a year. https://www.pbs.org/newshour/p...ing-of-classified-documents There is no credible legitimate comparison between the two classified documents cases. You might want to change the source of the information you are getting and falling for. They are quite obviously lying to you. PS On the content issue...I am a content creator. You and everyone else in the world loves the franchises and content I have created and/or contributed meaningfully to. It's the studios that are doing everything they can to remove us, the content creators, from their balance sheets (now with AI)...not the people who consume what we create for free. We've already been paid, thanks. Blame Wall Street for forcing the bottomless greedy enshittification of everything American, not the consumers, pirates, or the actual creators.
    • https://support.microsoft.com/...61ff-00a1-04e2-2d1f3865450d
    • https://support.microsoft.com/...61ff-00a1-04e2-2d1f3865450d
  • Recent Achievements

    • First Post
      sultangris earned a badge
      First Post
    • Reacting Well
      sultangris earned a badge
      Reacting Well
    • First Post
      ClarkB earned a badge
      First Post
    • Week One Done
      Epaminombas earned a badge
      Week One Done
    • Week One Done
      Prestige Podiatry Care earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      144
    2. 2
      Xenon
      127
    3. 3
      ATLien_0
      124
    4. 4
      +Edouard
      102
    5. 5
      snowy owl
      98
  • Tell a friend

    Love Neowin? Tell a friend!