copy a file from the web

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

copy a file from the web

Sylvain pralon

Hello,

 

I just want to do a simple thing I guess, but I do not manage …

I  have a seaside application which list me some file from the web.

I want to copy some of them onto my computer.

How can I do this ?

And is there a method which is able to clean an HTML stream.

I do not want to escape the HTML characters but I want to remove them.

 

Thanks

 

sylvain

Reply | Threaded
Open this post in threaded view
|

Re: copy a file from the web

Janko Mivšek
Hi Sylvain,

For your second question here is a method which strips all HTML tags
from a string:

String>>withoutHtmlTags
   "strip all tags, replace <br> and <p> with cr"
   | in out tag |
   in := self readStream.
   out := WriteStream on: String new.
   [in atEnd] whileFalse:
       [out nextPutAll: (in upTo: $<).
       in atEnd ifFalse: [tag := in upTo: $>].
       (tag = 'br') | (tag = 'p') ifTrue: [out nextPut: Character cr ]
       ^out contents

"'<span>by Michael A. <br>Prospero</span>' withoutHtmlTags"

Best regards
Janko


Sylvain Pralon wrote:

> Hello,
>
> I just want to do a simple thing I guess, but I do not manage …
> I  have a seaside application which list me some file from the web.
> I want to copy some of them onto my computer.
> How can I do this ?
> And is there a method which is able to clean an HTML stream.
> I do not want to escape the HTML characters but I want to remove them.
>
> Thanks
>
> sylvain
>

--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si