SitePoint Sponsor

User Tag List

Results 1 to 9 of 9

Hybrid View

  1. #1
    SitePoint Wizard ryanhellyer's Avatar
    Join Date
    Oct 2006
    Location
    New Zealand
    Posts
    2,323
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Transferring large'ish amounts of data between servers

    Hi,
    Apparently Internet Exploder is limited to URLs of only 2,000 characters or so in length. But I need to send about 10,000 characters between two different servers so sending it via the URL isn't going to work

    I've setup a test system which works by using readfile() to grab all the data from one server and placing it into a variable for use on the other server. Is this the standard way to do this? Or is there a better way to handle transferring large amounts of data between servers?

    Thanks for any input you may have

  2. #2
    Web Professional
    Join Date
    Oct 2008
    Location
    London
    Posts
    862
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It’s a bit like saying: “Hey, I need to travel from Berlin to Paris. I am driving a car. Is this a standard way to do this?”

    It depends on what you’re trying to achieve. One thing to note is the way you’re doing it currently is OK if you only need to pull data. If you need to push it then you can use, for example, cURL.

  3. #3
    SitePoint Wizard ryanhellyer's Avatar
    Join Date
    Oct 2006
    Location
    New Zealand
    Posts
    2,323
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks

    Quote Originally Posted by decowski View Post
    It’s a bit like saying: “Hey, I need to travel from Berlin to Paris. I am driving a car. Is this a standard way to do this?”
    LOL. Point taken I guess I should have said "is this a reasonable way to do this?".

    Quote Originally Posted by decowski View Post
    It all depends what you’re trying to achieve really. One thing to note is the way you’re doing it currently is OK if you only need to pull data. If you need to push it then you can use, for example, cURL.
    I'm using a form to post the data to the other server and process it. That side of things is working fine, the only problem I have (had) is grabbing the processed data and sending the result back to the other server. If the way I'm doing it isn't totally stupid then I'll stick with it

  4. #4
    PHP Guru lampcms.com's Avatar
    Join Date
    Jan 2009
    Posts
    921
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Tell us exactly what is it that you need to do. I mean what is in that data? how ofter do you want to transfer. Just describe the specific goals of that data transfer.
    There are many ways to do a transfer, the most common one is to use FTP, then there is an rsync, then there is a possibility to mount a drive on one server as an nfs partition and then you can simple use that partition from the other server as if it was a local drive.

    Then there is an option to just POST the data from one server using the http POST to a html form an another server.

    You see, there are many ways to transfer a server, it all depends on your specific situation.

  5. #5
    SitePoint Wizard ryanhellyer's Avatar
    Join Date
    Oct 2006
    Location
    New Zealand
    Posts
    2,323
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,
    Thanks for the reply. Another topic I made yesterday has converged on this one and this question is now being handled over there ... http://www.sitepoint.com/forums/showthread.php?t=611791

    The following is the description I used in the other topic of what I'm trying to do:
    Quote Originally Posted by Ryan
    I want to release a piece of software for download, which allows users to choose a bunch of different options. When they click submit, those options are sent through to my own server for processing. My server will process them and all the user to download CSS created during this processing (that's what the style.php file is for).

    I could store everything on my own server, but I want to make the bulk of the software free to download so that users can modify it for their own purposes. However for commercial purposes I want to keep the core code which does the processing on my own server.


    The catch here, is that the number of options in the form (test.php) will be quite large and so I can't just send the data back via the URL.

  6. #6
    ¬.¬ shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    What you are looking for is a web service, to give it a name. Send one server a special formatted message either via post or get. The server then either sends raw text, html, or even XML data detailing rather the request failed or so forth.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  7. #7
    SitePoint Wizard ryanhellyer's Avatar
    Join Date
    Oct 2006
    Location
    New Zealand
    Posts
    2,323
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yep, that sounds like it.

    I 'almost' have a working test system up and running now from help in my other topic If I run into any more problems I'll post back ... and try to make my questions clearer next time!

  8. #8
    SitePoint Wizard REMIYA's Avatar
    Join Date
    May 2005
    Posts
    1,351
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ryanhellyer View Post
    Hi,
    Apparently Internet Exploder is limited to URLs of only 2,000 characters or so in length. But I need to send about 10,000 characters between two different servers so sending it via the URL isn't going to work
    You can make Ajax frontend for interactive presentation to the end user, and PHP for backend sending of data. Then simply split and send the data in more reasonable packages. At the end join the data back in one piece.

  9. #9
    SitePoint Wizard ryanhellyer's Avatar
    Join Date
    Oct 2006
    Location
    New Zealand
    Posts
    2,323
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by REMIYA View Post
    You can make Ajax frontend for interactive presentation to the end user, and PHP for backend sending of data. Then simply split and send the data in more reasonable packages. At the end join the data back in one piece.
    Nice suggestion. Unfortunately I know absolutely nothing about Ajax so I'd need to do a lot of background reading to get that working I think. I have a working solution which stores the data in temporary files which seems to be working fine so I'll probably stick with that for the mean time.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •