Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Upload to different Domain

Status
Not open for further replies.

TheSponge

Technical User
Jul 2, 2003
442
GB
I have an upload script on my domain, which works fine,
But I want the uploader to upload files to a different domain I own,

The problem is here:

// Where will the file be uploaded to?
$uploaddir = $_SERVER['DOCUMENT_ROOT'] . "/Feb/";

I changed it to:

$uploaddir = "
doesnt work because of header wrappers or something?

can someone help please?

A+,Network +,CCNA
 
Insufficient data for a complete answer.

I don't know exactly how you're trying to move the file to the URL pointed to by $uploaddir, but if you're using move_uploaded_file(), I would not expect it to work. I don't think you can use a URL with that function.

Where does the other domain reside? If it's on the same file server as the file-receiving domain, it's possible that you could just write the file to the appropriate place on the server's filesystem.

If you must use HTML file uploads, you're going to have to use cURL to do it.



Want the best answers? Ask the best questions! TANSTAAFL!
 
Sponge,

If you're wanting to move the file to a different server once it is uploaded then I suggest simply using PHP's ftp functions to move it after it's uploaded.

- degroat
 
I will look into that, thankyou..

A+,Network +,CCNA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top