Uploading File In A Different Server

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Uploading File In A Different Server

    Hello

    suppose ive a site named domain.com now i want my members to upload their files to a different site like test.com.I meant the files only will be copied to the site test.com but the informations of that file and user will be sent to the database of domain.com .How to do that?

    ive tried by changing the permission of test.com to 777 bt it still showing

    'that site doesnt allow writeable connections.couldnt copy the file'

    Anyone to help..?
    thanks

    #2
    all i can say is if u somehow find a way DONT DO IT hackers will easily be able 2 upload files to ur server then lol

    Comment


      #3
      Originally posted by rainforest View Post
      Hello

      suppose ive a site named domain.com now i want my members to upload their files to a different site like test.com.I meant the files only will be copied to the site test.com but the informations of that file and user will be sent to the database of domain.com .How to do that?

      ive tried by changing the permission of test.com to 777 bt it still showing

      'that site doesnt allow writeable connections.couldnt copy the file'

      Anyone to help..?
      thanks
      yes u can do it ask your domain.com host for database details if u wanna operate it from other site . then connect ur database of domain.com from test.com

      Comment


        #4
        u can do it but you realy dont want to do it belive me
        Creator of
        Epix.Mobi

        Keep an Eye on us Big things coming soon!!!!
        Need something for your site hit me up here

        http://coding-talk.com/forum/main-fo...r-your-wapsite

        Comment


          #5
          if you making a file host with diff mirrors you can do it by password or a set key with forse headers to stop it showin where you put it

          like this

          uploaded to one host then you uploaded to all cpanel

          domain1
          domain2
          domain3

          so when a user download it he or she can pick what data speed she likes

          abit like rapidshare ??
          Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
          Visit: WapMasterz Coming Back Soon!
          _______
          SCRIPTS FOR SALE BY SUBZERO
          Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
          FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
          _______
          Info & Tips
          php.net
          w3schools.com

          Comment


            #6
            Originally posted by rainforest View Post
            Hello

            suppose ive a site named domain.com now i want my members to upload their files to a different site like test.com.I meant the files only will be copied to the site test.com but the informations of that file and user will be sent to the database of domain.com .How to do that?

            ive tried by changing the permission of test.com to 777 bt it still showing

            'that site doesnt allow writeable connections.couldnt copy the file'

            Anyone to help..?
            thanks
            I Can Create A Safe Uploading System That Uploads To (Domain B ) Without Leaving (Domain A ).
            But (Domain B ) Has To Be A Decent Server.


            The Only Question Is It worth Me Coding It For Free?*:p lol
            Last edited by something else; 12.05.09, 12:18. Reason: Smileys Showed instead of B )

            Comment


              #7
              you can try this class: http://www.phpclasses.org/browse/package/3753.html
              i havent tested it but it uses curl ant it is the best way to upload files to other servers.

              and here is a simple example:
              HTML Code:
              <form action="curlupload.php" method="post" enctype="multipart/form-data">
              <div>
              <label for="upload">Select file</label>
              <input name="upload" type="file" />
              <input type="submit" name="Submit" value="Upload" />
              </div>
              </form>
              PHP Code:
              if (isset($_POST['Submit'])) {
               if (!empty(
              $_FILES['upload']['name'])) {
                   
              $ch curl_init();
                   
              $localfile $_FILES['upload']['tmp_name'];
                   
              $fp fopen($localfile'r');
                   
              curl_setopt($chCURLOPT_URL'ftp://ftp_login:password@ftp.domain.com/'.$_FILES['upload']['name']);
                   
              curl_setopt($chCURLOPT_UPLOAD1);
                   
              curl_setopt($chCURLOPT_INFILE$fp);
                   
              curl_setopt($chCURLOPT_INFILESIZEfilesize($localfile));
                   
              curl_exec ($ch);
                   
              $error_no curl_errno($ch);
                   
              curl_close ($ch);
                      if (
              $error_no == 0) {
                          
              $error 'File uploaded succesfully.';
                      } else {
                          
              $error 'File upload error.';
                      }
               } else {
                      
              $error 'Please select a file.';
               }

              copy and paste from:


              and if you need more examples or tips you can try this link: http://www.google.com/search?hl=en&q...=php+curl+file
              Advertise your mobile site for FREE with AdTwirl

              Comment


                #8
                Originally posted by Anshul View Post
                yes u can do it ask your domain.com host for database details if u wanna operate it from other site . then connect ur database of domain.com from test.com
                a bit offtopic question...
                but still...

                only host can give out database details?
                is there any other way to get details?
                It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt.
                ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ !
                ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.
                キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

                Comment


                  #9
                  Originally posted by metulj View Post
                  a bit offtopic question...
                  but still...

                  only host can give out database details?
                  is there any other way to get details?
                  yep you can ask from your host about it

                  instead of localhost you need to write
                  $DB_HOST = "localhost";

                  wat your host tell you like in freehostia database host is somethink like this
                  $DB_HOST = "mysql.freehotia.com";

                  Comment


                    #10
                    Originally posted by Anshul View Post
                    yep you can ask from your host about it

                    instead of localhost you need to write
                    $DB_HOST = "localhost";

                    wat your host tell you like in freehostia database host is somethink like this
                    $DB_HOST = "mysql.freehotia.com";

                    I Thought There is a code you have to place in your database to except external server ip number. (because of security issues)
                    I cant remember what the code is tho lol

                    (apart from on freehostia)
                    Last edited by something else; 12.05.09, 16:53.

                    Comment


                      #11
                      Originally posted by something else View Post
                      I Thought There is a code you have to place in your database to except external server ip number. (because of security issues)
                      I cant remember what the code is tho lol

                      (apart from on freehostia)
                      Remote Database Access Hosts

                      You can allow external web servers to access your MySQL databases by adding their domain name to the list of hosts that are able to access databases on your web site.
                      Add Access Host

                      Host (% wildcard is allowed):

                      Comment


                        #12
                        Many hosts dont allow curl functions
                        So I do like this
                        PHP Code:
                        <?php
                        function rukiyaupload($from,$to)
                        {
                        if(!@
                        copy($from,$to))
                        {
                            
                        $errorserror_get_last();
                            echo 
                        "UPLOAD ERROR: ".$errors['type'];
                            echo 
                        "<br />\n".$errors['message'];
                        } else {
                            echo 
                        "File uploaded from $from successfully!";
                        }
                        }

                        rukiyaupload('http://www.example.com/somefile.zip','./somefile.zip'));
                        ?>


                        or
                        PHP Code:
                        <?php 
                        $file 
                        "http://www.example.com/sample.zip"
                        $f explode("/",$file); 
                        $end end($f); 
                        file_put_contents($endfile_get_contents($file));
                        ?>
                        Last edited by rukiya; 13.05.09, 05:32.

                        Comment


                          #13
                          you can do it by connecting to remote database.

                          in database connection, set host address of the database with its details. so all of your queries will be fired on that db
                          Follow me @ksg91 | My Blog: http://ksg91.com | Nokia Blog: http://NokiaTips.in

                          Comment


                            #14
                            Why all this tired work and messed code?
                            Why not upload to domain.com and immediately transfer to test.com, then delete the file?
                            I would do this.
                            mysterio.al - programming is a functional art

                            Comment

                            Working...
                            X