/    Sign up×
Community /Pin to ProfileBookmark

Upload Files From Remote Server

I’m looking for a way to upload files from a remote server to my web server. Is there any way to go about doing this, or some example code?

Thanks

to post a comment
PHP

7 Comments(s)

Copy linkTweet thisAlerts:
@michael879Mar 04.2007 — you mean you want to be able to upload files from a computer to ur website? There are plenty of examples on this. http://www.w3schools.com/php/php_file_upload.asp

is the one I used to learn.
Copy linkTweet thisAlerts:
@The_WandererauthorMar 05.2007 — No I want to upload a link from another website to my server
Copy linkTweet thisAlerts:
@michael879Mar 05.2007 — ah, well you can use fopen() on the url. To do that you have to make sure some setting in php.ini is turned on. Its the only setting with the word fopen in it. You can also use curl if you install that extension.
Copy linkTweet thisAlerts:
@The_WandererauthorMar 05.2007 — Do you know of any such scripts that already exist?
Copy linkTweet thisAlerts:
@michael879Mar 05.2007 — its pretty simple... call fopen($url,"r"). then use fread to read the file into a string. Than you can do whatever you want with it. Curl is slightly more complicated but a google search will give u plenty of code.
Copy linkTweet thisAlerts:
@The_WandererauthorMar 05.2007 — Thank! That worked well!
Copy linkTweet thisAlerts:
@michael879Mar 05.2007 — cool, lucky you lol. The web host Im currently using to make a website for a friend disabled any outgoing connections to other servers. Took me three days of messing around with curl, and php.ini to figure out what was going on.
×

Success!

Help @The_Wanderer spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.1,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...