How do I handle file uploading on distributed application?

喜欢而已 提交于 2019-12-12 01:42:08

问题


I have photo uploading functionality in web application using PHP. Which is going to host as distributed application on many servers.

Now, problem is how should I handle that photo uploading functionality so, that photo can be available on all server? My application is in php.


回答1:


You could use an already existing platform to perform syncing. Most modern OSes support syncing, and you could also use external tools.

At the OS level:

  • You can use rsync for *nix servers (plus, this has been ported to Windows too)
  • Here's a way to do it between Windows servers

Using external tools:

  • Goodsync enterprise
  • Syncbreeze
  • Under *nix, you could use rsync
  • Here's a collection of programs (free and paid) to do this
  • You could use a cloud-based service like Dropbox in all your servers

Using PHP:

  • You could use librsync
  • You could add an FTP/SSH server to each one of your distributed servers. Once a file is uploaded to one server, it can be uploaded via FTP to the others. PHP includes functionality for FTP - check the FTP section in the PHP handbook.
  • Use FXP to transfer files between servers. The KioobFTP class can be used for this, as it implements FXP transfers


来源:https://stackoverflow.com/questions/17022047/how-do-i-handle-file-uploading-on-distributed-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!