Jump to content

Recommended Posts

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.

 

 

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.

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.

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.