[etoys-dev] Bug trying to download Etoys projects from a XO laptop

Bert Freudenberg bert at freudenbergs.de
Mon May 30 15:48:06 EDT 2011

Hi Bruno,

I will cc the Sugar list because is more of a Sugar problem than an Etoys problem.

I tried downloading your http://etoysnodinah.pbworks.com/f/1255_cachorros.001.pr

As far as I can tell, it is not working correctly because your server sends the content type "application/x-pr". This is the header I see:

HTTP/1.1 200 OK
Server: nginx/0.6.32
Date: Mon, 30 May 2011 19:12:59 GMT
Content-Type: application/x-pr
Connection: keep-alive
Set-Cookie: pbj=93a79c8d2090521fc389959c8d04001306782779; expires=Fri, 01-Jan-2038 00:00:00 GMT; path=/; domain=.pbworks.com
Content-Disposition: attachment; filename="1255_cachorros.001.pr"
Cache-Control: public, max-age=3600
Expires: Mon, 30 May 2011 20:12:59 GMT
Last-Modified: Tue, 17 May 2011 20:43:53 GMT
Accept-Ranges: bytes
Content-Length: 48104

This content type is unknown to Sugar, so it stores it as a generic "data" entry in the Journal. The entry does not have an Etoys icon. Also, in the entry's details page in the Journal, it shows the type as application/x-pr.

Now, when opening that file, Sugar does not use the original file name. It creates a new file name with a ".htm" extension (I have no idea why "htm"). Etoys sees that .htm file extension and displays the file in a text window, because it does not guess it is a project.

Unfortunately, there is no way to adjust the type of a Journal entry in the detail view. There may be some command line magic, but it is not trivial AFAIK. The real fix is to change the content type on your server.

FIX: Change the content type for ".pr" files on the server to "application/octet-stream". If Sugar sees that type, it will try to guess the right type from the file extension, and mark it correctly as Etoys project.

(this is usually better than using the actual MIME type for Etoys projects because it simply forces a download of the project)

Hope that helps,

- Bert -

On 30.05.2011, at 17:06, Bruno Sperb wrote:

> Hey all,
> Im Bruno, from Porto Alegre, Brazil. Im writing to tell you about a specific problem im facing, and see if you guys can help me with it. 
> We are currently working with a group of students on weekly workshops (they have XOs laptops, running SUGAR), and want to leave them challenges (etoys projects) on the web for them to download at home (as well as getting them to upload their projects). We are using an environment called pbworks, wich works pretty much as a regular wiki page, where each student has their own page.
> - Bug downloading projects in the XO:
> We left a link on a wiki page just like shown on the picture below:
> <linkwikipage.png>
> Once you click on the link, it downloads to the sugar´s journal as: Arquivo 1255_cachorros.001.pr de http://etoysnodinah.pbworks.com/f/1255_cachorros.001.pr
> I then tried opening in Etoys both from the journal, copying to clipboard or from Etoys, getting the same message (it seems, to me, that Etoys is opening it as a .html file, but it is really dificult to understand, as I dont know much about the codes)
> <testdownload.png>
> When uploading a .pr file from the XO, it does alrigth, although changing the file .pr name to a .tmp. I can download and open the file normally from a regular laptop, but when try from the XO, the same problem as explained above happens.
> Any idea what I am doing wrong?
> Thanks a lot in advance,
> all the best,
> Bruno Sperb
> ps: I am constantly following the Xo discussions lists, but could not get an answer to this problem...

More information about the etoys-dev mailing list