Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Newbie read question?

 [1/7] from: kpeters::vu-ware::com at: 2-Mar-2005 17:14


Hi all ~ am trying to download two (or more) PDFs as per my script below - but all I ever end up with is the correct number of files with only ~ 1.5 k each instead of their proper sizes. What am I doing wrong? Thanks, Kai REBOL[] pdfs: [ "06 - Aquatics.pdf" "07 - Aquatics.pdf" ] baseurl: "http://kelowna.ca/citypage/scripts/PDF_Display.cfm?ftd=../docs/pdfs/Departments/Parks and Leisure Services/Brochure/Previous Brochures/Brochure 2004c Summer/" foreach pdf pdfs [ cururl: to-url append copy baseurl pdf fname: append copy %/c/ pdf print pdf write/binary fname read/binary cururl ] print "Done"

 [2/7] from: tom::conlin::gmail::com at: 2-Mar-2005 20:52


first geuss is if you looked at the data returned, it would be a 1.5k page saying the url is not found On Wed, 2 Mar 2005 17:14:34 -0800, Kai Peters <[kpeters--vu-ware--com]> wrote:
> Hi all ~ > am trying to download two (or more) PDFs as per my script below - but all I
<<quoted lines omitted: 23>>
> To unsubscribe from the list, just send an email to rebol-request > at rebol.com with unsubscribe as the subject.
-- ... nice weather eh

 [3/7] from: tom:conlin:gma:il at: 2-Mar-2005 22:00


do http://www.cs.uoregon.edu/~tomc/url-encode.r pdfs: [ 06 - Aquatics.pdf 07 - Aquatics.pdf ] baseurl: http://kelowna.ca/citypage/scripts/PDF_Display.cfm? pc-crap: {ftd=..\docs\pdfs\Departments\Parks and Leisure Services\Brochure\Previous Brochures\Brochure 2004c Summer\} foreach pdf pdfs[ cururl: join baseurl url-encode/re join pc-crap pdf ; note: RE-encoding query string fname: join %/c/junk/ pdf write/binary fname read/binary cururl ] ---------- this seems to work. On Wed, 2 Mar 2005 20:52:52 -0800, Tom Conlin <tom.conlin-gmail.com> wrote:
> first geuss is if you looked at the data returned, > it would be a 1.5k page saying the url is not found
<<quoted lines omitted: 44>>
> -- > ... nice weather eh
-- ... nice weather eh

 [4/7] from: kpeters:vu-ware at: 3-Mar-2005 10:45


Thanks, Tom ~ that was exactly it. How come I can cut & paste the url from my script below in any browser and it will download the PDF. Rebol, however, fails every time. What could be the reason? Thanks for any help, Kai Rebol[] url: http://kelowna.ca/citypage/scripts/PDF_Display.cfm?ftd=../docs/pdfs/Departments/Parks and Leisure Services/Brochure/Previous Brochures/Brochure 2004c Summer/06 - Aquatics.pdf write/binary %/c/Aquatics.pdf read/binary url

 [5/7] from: tom::conlin::gmail::com at: 3-Mar-2005 11:15


hmm that url shows up as a link, but ut fails when I click on it... I see "funny chars" in all your posts ... mac user? different charset? Im not sure but if those chars ("=" at every newline ) are leaking into your scripts they could cause errors in your url. they do wreck the one in this email. but before the line-wrapping ... most likely because browsers will rewrite the urls to be properly encoded before sending them and rebol will send what you give it notice the first back-slash is converted to hex encoding and the rest have become forwad-slash. space is often converted to plus-signs not hex encoded tho both should work On Thu, 3 Mar 2005 10:45:13 -0800, Kai Peters <[kpeters--vu-ware--com]> wrote:
> Thanks, Tom ~ > that was exactly it.
<<quoted lines omitted: 12>>
> To unsubscribe from the list, just send an email to rebol-request > at rebol.com with unsubscribe as the subject.
-- ... nice weather eh

 [6/7] from: antonr::lexicon::net at: 4-Mar-2005 15:00


Mmm. Interesting redirection problem I think. If I do: trace/net on cont: read/binary url then I see lots of Net-log: "HTTP/1.1 302 Object Moved" and after about five redirections I have this: Net-log: {GET /////citypage/scripts/PDF_Display.cfm?ftd=../docs/pdfs /Departments/Parks and Leisure Services/Brochure/Previous Br ochures/Brochure 2004c Summer/%2E%2E%2Fdocs%2Fpdfs%2FDepartments %2FParks and Leisure Services%2FBrochure%2FPrevious Brochure s%2FBrochure 2004c Summer%2F%2E%2E%2Fdocs%2Fpdfs%2FDepartments%2 FParks and Leisure Services%2FBrochure%2FPrevious Brochures% 2FBrochure 2004c Summer%2F%2E%2E%2Fdocs%2Fpdfs%2FDepartments%2FP arks and Leisure Services%2FBrochure%2FPrevious Brochures%2F Brochure 2004c Summer%2F%2E%2E%2Fdocs%2Fpdfs%2FDepartments%2FPar ks and Leisure Services%2FBrochure%2FPrevious Brochures%2FBr ochure 2004c Summer%2F06 %2D Aquatics.pdf HTTP/1.0 and it continues to grow and grow. (Furthermore, the first instance of REBOL/View 1.2.57.3.1e I tried this in suddenly quit when I tried restarting the read after a few previous times.) I noticed that Firefox recoded the URL, into this: http://kelowna.ca/citypage/scripts/%2E%2E%2Fdocs%2Fpdfs%2FDepartm ents%2FParks and Leisure Services%2FBrochure%2FPrevious Bro chures%2FBrochure 2004c Summer%2F06 %2D Aquatics.pdf Without checking, it seems to me that perhaps the original url uses non-standard characters... so it might be the fault of rebol in not encoding those illegal characters properly. Not sure at this time. Anton.
> Thanks, Tom ~ > that was exactly it.
<<quoted lines omitted: 7>>
> url: > http://kelowna.ca/citypage/scripts/PDF_Display.cfm?ftd=../docs/p
dfs/Departments/Parks and Leisure Services/Brochure/Previous Brochures/Brochure 2004c Summer/06 - Aquatics.pdf write/binary %/c/Aquatics.pdf read/binary url

 [7/7] from: kpeters::vu-ware::com at: 4-Mar-2005 9:31


Anton ~ I copy and paste the URL from a file which I have just inspected with a hex editor for any unusual characters and it does not contain anything besides alphas, numbers and six specials: dot, colon, slash, question mark, equal sign and percent. I also noticed what you have found (though w/o tracing): Depending on the Rebol version, I either get tons of "connecting to: kelowna.ca" messages on the console or nothing at all before it finally gives up. Kai On Fri, 4 Mar 2005 15:00:30 +1100, Anton Rolls wrote:

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted