This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-10-16 17:53:26

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Help with downloading files through Squeak

I'm currently writing code to download files from Mod Share directly within Insanity.

Currently, I'm running into a slight problem.

Here is my code to do it:

Code:

httpGetProject: id withFrame: scratchFrame 
    | projData downloadPath t3 |
    scratchFrame saveScratchProjectNoDialog.
    downloadPath _ 'download1.ins'.
    projData _ (HTTPSocket httpGet: 'http://modshare.tk/data/projects/' , id asString) contents.
    t3 _ (FileStream fileNamed: downloadPath) binary.
    t3 ifNil: [^ self].
    t3 setToEnd.
    t3 nextPutAll: projData.
    t3 close.
    scratchFrame openScratchProjectNamed: downloadPath

However, when it tries to open the file, it gives me a "Bad header" error.


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#2 2012-10-16 20:44:29

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Re: Help with downloading files through Squeak

Never mind, I got this. Requesting to be closed...


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#3 2012-10-16 20:55:17

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Help with downloading files through Squeak

Closed by request of the topic owner.


http://i39.tinypic.com/2nav6o7.gif

Offline

 

Board footer