How to programmatically transfer a file from linux php server to windows .net server?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ricky Brooks
    New Member
    • Jul 2010
    • 4

    How to programmatically transfer a file from linux php server to windows .net server?

    So I have a bit of an issue. I need to make it so that files are automatically transferred from one server to another. The originating server using a linux OS and runs an php web application. The second uses a windows OS and runs ASP.NET 2.0 applications most written in C#. It is not an option to install php on the windows servers. The two servers do not have visibility of one another.

    I'm considering writing a webservice in ASP.NET that can be called from PHP, passing the needed file as a parameter. Unfortunately, I'm not sure how (or if) I can pass a file from PHP that can be read through an ASP.NET language (such as C#).

    Can anyone give me some advice?
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    #2
    is it a text file or binary file?

    Comment

    • Ricky Brooks
      New Member
      • Jul 2010
      • 4

      #3
      They will be powerpoint files; so, binary.

      Comment

      • chathura86
        New Member
        • May 2007
        • 227

        #4
        yes a web service can be used to transfer the file, encode the file as base64 or similar and decode it in the C# and save it

        or if you can create a file upload form in C# and submit that form from PHP (Snoopy will help you)

        as the third you can also use FTP (FTP server in windows and client in php server)

        Regards

        Comment

        • Ricky Brooks
          New Member
          • Jul 2010
          • 4

          #5
          Originally posted by chathura86
          yes a web service can be used to transfer the file, encode the file as base64 or similar and decode it in the C# and save it

          or if you can create a file upload form in C# and submit that form from PHP (Snoopy will help you)

          as the third you can also use FTP (FTP server in windows and client in php server)

          Regards
          Thanks chathura.

          The file upload form isn't a possibility, since lots of information is posted to a php page in the same action that I need this file transferred.

          I'm curious about the FTP solution. It still may not work since there isn't visibility of each other. Can you point me towards more information?

          Comment

          • Oralloy
            Recognized Expert Contributor
            • Jun 2010
            • 988

            #6
            Just how do your servers communicate in the first place?

            If they can't connect using IP sockets, are you relying on SOAP communications, or something else?

            Basically all the "standard" communications methods are already canned and readily available.

            Can you tell us what communications paths are available?

            Comment

            • chathura86
              New Member
              • May 2007
              • 227

              #7
              Originally posted by Ricky Brooks
              Thanks chathura.

              The file upload form isn't a possibility, since lots of information is posted to a php page in the same action that I need this file transferred.

              I'm curious about the FTP solution. It still may not work since there isn't visibility of each other. Can you point me towards more information?
              The file upload form isn't a possibility, since lots of information is posted to a php page in the same action that I need this file transferred.
              yes you can execute those actions and let the php script to upload the file (not by using a form in the php site which submit to the .net site)
              any way you cannot do anything without visibility to each other. you need to have a way to pass a message from one server to another. a ip, domain or any other

              Regards

              Comment

              • Ricky Brooks
                New Member
                • Jul 2010
                • 4

                #8
                When I say they don't have visibility, I mean I can't type in a network path to copy files directly from the windows machine to linux, or vice-versa. I am able to use ftp programs to do this, however.

                It's probably become obvious at this point that OS and network setups are not my speciality. I'm not entirely sure how things are set up. Perhaps I'll talk with my systems team for more informaiton.

                Comment

                • Oralloy
                  Recognized Expert Contributor
                  • Jun 2010
                  • 988

                  #9
                  If the windows server is running FTP, perhaps your best bet is FTP.

                  Use an FTP client object or shell off an FTP script on your Linux system, depending on what works best for your needs.

                  Alternately, if the Linux you are using is a later version, it may already have drivers for windows networking built in. In this case, you should be able to get into network shares on the windows box from the file browser.

                  As a last resort, you could build an applet on the windows machine and use HTTP to transfer the file from php - but that seems like way too much work.

                  Comment

                  Working...