开发者

How to limit upload speed for MAMP

I am using MAMP to test my javaScript/flash based website locally. It uses a small php script running on MAMP (Apache 2.0.63) to receive a file uploaded via post from the client. In order to test the upload progress without using huge files I would like to know if there is a fairly easy way to limit the bandwidth for data upload of the Apache server in MAMP, or another better solution? Thanks in advance for your help开发者_如何学C.


I've used the Speed Limit app to slow down my internet connection enough to test loading screens and file progress bars: http://mschrag.github.com/

Apparently there's also an XCode app called Network Link Conditioner that does something similar. See this thread: Where is Network link conditioner Prefpane in OSX Mountain Lion and Xcode 4.4


There are a nice trick to limit the download speed in PHP, basiclly you opend the file you want to send, and send it by chunks of download speed, after you sleep for the rest of the second and repeat until you finish with the file.

You can see an snippet here.

Best regards.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜