upload image to another server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ammu
    New Member
    • Aug 2011
    • 78

    upload image to another server

    I am doing a php site. My client have two web sites. But he need to handle both sites by a single admin. I have uploaded data to both databses by using multiple database connection. But my problem is how to upload image to another server. is it possible to do ?
  • Oralloy
    Recognized Expert Contributor
    • Jun 2010
    • 988

    #2
    Ammu,

    What is wrong with uploading twice? Or, is that not workable solution for your client?

    One option would be to create a group of PHP pages which upload an image, and then run a back-end process to move the image file to its final destination on both of the servers.

    Another solution that I used to address security issues with image files (and issues with malbehaved staff) was to host the site's images in the database. That way the images were easily auditable (and difficult for the afforementioned staff to manipulate). I used a simple CGI script to access them, transparently, as if they were residing in the "image" directory of the file system.

    Hope that helps.

    Cheers,
    Oralloy

    Comment

    • Ammu
      New Member
      • Aug 2011
      • 78

      #3
      @Oralloy thank you for your reply. But how to to move the image file to its final destination? please help me to do that back-end process..

      ammu

      Comment

      • Oralloy
        Recognized Expert Contributor
        • Jun 2010
        • 988

        #4
        Good Morning, Ammu,

        What have you done so far? Have you got a specific technical approach in mind?

        Perhaps even more basically, what is the infrastructure that you are working on?

        From reading some of your other threads, it looks like you are developing against Linux servers.

        Are both your sites on one server/virtual-machine, or are they on separate servers/virtual-machines? Do they share a common NFS file-system?

        Without knowing anything else, I would recommend that you use the FTP capability that is native in PHP. When I looked at the PHP site, there were some rather nice examples available in both the reference itsself, and in the users' comments.

        PHP FTP Reference
        PHP FTP Examples
        Kind Regards,
        Oralloy

        Comment

        Working...