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:
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.
Offline