开发者

Should I use HTTP or FTP to upload images from the North Pole?

开发者 https://www.devze.com 2023-02-09 05:27 出处:网络
Here\'s an interesting request. A client will need to blog from the north pole. Their connection speed on their Satellite phone is really poor, so everything needs to be as lean as possible.

Here's an interesting request. A client will need to blog from the north pole. Their connection speed on their Satellite phone is really poor, so everything needs to be as lean as possible.

In the past, they've submitted text via a HTML form over HTTP, and FTP'd the images.

Anecdotally, from he comfort of my desk with a high speed broadband connection, It feels like HTTP is much faster for uploading files, compared to FTP. But I开发者_如何学Python'm just a coder, I know nothing of the underlying technology that get's data from one part of the web to another so I thought it best to double check with people who tend to know a lot more about these things

I suppose the issues are: Bandwidth, & Reliability.

So, given these very strict conditions

  1. Lower than dialup bandwidth
  2. Any number of Small Images (300x300px 72ppi)
  3. Text data (max 1500 chars)

Should they use FTP or HTTP to upload images from the North Pole?


Definitely HTTP if the client and server support partial upload. The reason is that FTP is a command-response protocol and with lousy connection it's quite easy to lose it even before it gets to uploading the file. Next, FTP requires two socket connections which is additional network load (and possible weak place in case of non-stable connection).

The question becomes more complicated if you can't provide partial upload capability (i.e. if the upload of the file fails, the file is re-uploaded completely). Then you need to decide, if connection is more slow or more unreliable (i.e. lost frequently), i.e. whether the chance of connection drop is higher than the overhead of FTP's secondary connection.


This document neatly spells out the differences between FTP and HTTP for file transfers: http://daniel.haxx.se/docs/ftp-vs-http.html

HTTP is most likely the best solution for the North Pole Blogger.


I'm not really into to real protocol level there either - I personally would prefer FTP for the advantage of being able to resume a transfer....might be able to code that using HTTP also but it's already implemented in FTP. If your short on Bandwidth you probably don't want to reupload if your connection got kicked for a sec...

0

精彩评论

暂无评论...
验证码 换一张
取 消