Welcome Guest, Not a member yet? Register   Sign In
Uploading images from url rather than local hard drive
#4

[eluser]HdotNET[/eluser]
be very careful though. that's asking for a hacker to upload anything he/she/it wants. many shared hosts will have functions like disabled to prevent the above:

allow_url_fopen = off

in php.ini...

errors like these indicate this:

PHP Warning: fopen(http://www.example.com): failed to open stream: HTTP request failed!
fsockopen(): unable to connect to …
file_get_contents(): failed to open stream: HTTP request failed!
PHP Warning: main(): Failed opening ‘http://www.example.com/index.html’ for inclusion …
PHP Warning: include(/usr/local/index.php): failed to open stream: No such file or directory in …


in addition, you may find that other webservers may block requests from the user_agent 'PHP', so if you still want to go ahead with this scary bit of coding, you may want to spoof the user_agent to something more acceptable.


Messages In This Thread
Uploading images from url rather than local hard drive - by El Forum - 04-23-2008, 08:41 PM
Uploading images from url rather than local hard drive - by El Forum - 04-23-2008, 10:24 PM
Uploading images from url rather than local hard drive - by El Forum - 04-24-2008, 12:49 AM
Uploading images from url rather than local hard drive - by El Forum - 04-24-2008, 03:26 AM
Uploading images from url rather than local hard drive - by El Forum - 04-24-2008, 08:37 AM
Uploading images from url rather than local hard drive - by El Forum - 04-24-2008, 08:46 AM
Uploading images from url rather than local hard drive - by El Forum - 04-24-2008, 08:52 AM
Uploading images from url rather than local hard drive - by El Forum - 04-24-2008, 08:54 AM
Uploading images from url rather than local hard drive - by El Forum - 04-24-2008, 09:09 AM



Theme © iAndrew 2016 - Forum software by © MyBB