brianbehrens Posted October 18, 2007 Share Posted October 18, 2007 I'm interested and somewhat puzzled as how to get this to work. I have been working on a centralized admin running off my webserver to administer several clients websites. The admin and databases are all hosted on my server and I working great. The one issue I am having is regarding uploading images to my clients server, meaning uploading to a whole new domain. I'm uploading from my server "abc.com" to "xyz.com/images".... I think that's pretty clear. I've tried folder permissions and other things, but I can't really seem to get this to work. Is there configuration that need to be done on my server or theirs to make this happen? the code I'm using to upload images is pretty standard. It's erroring when I try to move the uploaded file: move_uploaded_file($_FILES['upload']['tmp_name'], "http://www.xyz.com/images/$filename" This isn't completing successful. I'm know there has to be a way to do this. I've seen it done in other admins... also I've seen it done uploading to subdomains. Any insight would be a great help. Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/73744-uploading-images-to-a-different-server-through-an-admin/ Share on other sites More sharing options...
cooldude832 Posted October 18, 2007 Share Posted October 18, 2007 Internal paths are different than what most people think. The problem is you are using a pointer that would be like if you used an anchor or an image tag. Look into the http://us2.php.net/manual/en/language.variables.predefined.php it will help explain this with the $_SERVER['document_root'] and so forth. The idea is you need an internal file point to tell it where to go not an external one like http://www.google.com this just doesn't work. Quote Link to comment https://forums.phpfreaks.com/topic/73744-uploading-images-to-a-different-server-through-an-admin/#findComment-372107 Share on other sites More sharing options...
brianbehrens Posted October 18, 2007 Author Share Posted October 18, 2007 So from what I understand, you are saying it is not possible to upload images from my server/host provider to my clients server, which is different than my own. I can't reference their image foler through relative paths. Are you suggesting I can change the DOCUMENT_ROOT variable? This doesn't seem possible. From what I'm understanding it ins't even possible to do this. Quote Link to comment https://forums.phpfreaks.com/topic/73744-uploading-images-to-a-different-server-through-an-admin/#findComment-372259 Share on other sites More sharing options...
brianbehrens Posted October 18, 2007 Author Share Posted October 18, 2007 I've discovered an simple solution. Using FTP functions with PHP. Easily done. I also discovered some socket functions that might allow me to do this with out FTP, but they're much more complex. Quote Link to comment https://forums.phpfreaks.com/topic/73744-uploading-images-to-a-different-server-through-an-admin/#findComment-372380 Share on other sites More sharing options...
cooldude832 Posted October 19, 2007 Share Posted October 19, 2007 that will work, however if they are on the same system they technically are in the htdocs folder and you should be able to do it, but this will work. Quote Link to comment https://forums.phpfreaks.com/topic/73744-uploading-images-to-a-different-server-through-an-admin/#findComment-372822 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.