Forum Moderators: coopster

Message Too Old, No Replies

PHP Script - Uploading Files In Multiple Domain

How to upload file in multiple domain

         

itnecor

6:09 am on Jul 20, 2005 (gmt 0)

10+ Year Member



I just want to ask how can upload a file in multiple domains, example I want to upload "thisfile.gif" to www.domain1.com and www.domain2.com.

Usually I'm using this code in uploading.

move_uploaded_file($_FILES['name']['tmp_name'], "/path/")

But I dont think so if it is applicable with my problem.

Please advise

coopster

1:25 pm on Jul 20, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



copy() [php.net] may work, depending on your server settings and permissions.

lobo235

3:01 pm on Jul 20, 2005 (gmt 0)

10+ Year Member



If the domains are hosted on the same server then you should be able to use either copy() or move_uploaded_file() to put it on the second domain. If they are on different servers you will need to use another method. You could use the ftp functions [php.net] in PHP to put the file on the second domain for example.

Dude3609

9:06 am on Jul 24, 2005 (gmt 0)

10+ Year Member



wouldn't ftp go slow for file uploading? Moving it to another domain name.. Because it would have to connect each time right? Or can it stay connected constantly to ftp for all files to be uploaded instead of having to connect for each seperate file?

lobo235

3:20 pm on Jul 24, 2005 (gmt 0)

10+ Year Member



If all the files are uploaded in a single submit then you could leave the ftp connection open and ftp all the files in one ftp connect. Chances are that the ftp will be quite fast between servers though. Most web servers have a pretty large amount of bandwidth they can utilize.