[Sugar-devel] Simulate a download
James Cameron
quozl at laptop.org
Tue Jan 5 23:06:59 EST 2016
On Wed, Jan 06, 2016 at 09:26:32AM +0530, Utkarsh Tiwari wrote:
> Is there any way to simulate a download in browse activitiy locally
> without actually downloading a file from internet. I need this to test
> a feature-enhancement.
Yes.
You might run a local web server using the python module
SimpleHTTPServer, then you can download from that without using the
internet.
Create an empty directory, put a file or two in it that you want to
download, then cd to that directory and type "python -m
SimpleHTTPServer".
It will say something like "Serving HTTP on 0.0.0.0 port 8000", so
then you can open http://localhost:8000/ in Browse activity.
It gets more complex if you want to manipulate the content-type, but
for plain content it should work. Otherwise install Apache.
--
James Cameron
http://quozl.netrek.org/
More information about the Sugar-devel
mailing list