Hi again Graham, No luck on all fronts, I'm afraid. Chris's protocol works on XP but not on Linux, same as your program. And your header capture modification doesn't seem to be working, in that protocol-http-header stays at none on Linux. (It gets the header object on XP.)
The error occurs in the Get-s3object function, it not being able to return result. (Which you probably know.) Also, success in the protocol doesn't seem to be called, suggesting the error happens before it gets that far. I added a print comment to success before the line with save-header in, and while it prints the comment in XP it doesn't in Linux. Where to now? :) -- Carl Read. On Monday, 20-September-2010 at 20:57:24 Graham Chiu wrote, >Carl > >the errors are not very informative, but the headers sent by Amazon do hold >the error information you need. >So, we need to modify the http protocol to give this to us .. eg. > >create a global to capture the headers > >protocol-http-header: none > >at the top of the protocol, add this function > >unless port/locals [port/locals: make object! [list: copy [] headers: none >querying: no]] >generic-proxy?: all [port/proxy/type = 'generic not none? port/proxy/host] >>>> add here >save-header: func [ obj ][ >protocol-http-header: obj >obj >] > >and change the success function to this: > >success: [ >headers: make string! 500 >while [ ( line: pick port/sub-port 1 ) <> "" ] [append headers join line >"^/"] ; remove the headers >port/locals/headers: headers: save-header Parse-Header HTTP-Header headers >port/size: 0 >if port/locals/querying [if headers/Content-Length [port/size: load >headers/Content-Length]] >if error? try [port/date: parse-header-date headers/Last-Modified] >[port/date: none] >port/status: 'file >] > >so, now when it fails, you can inspect the value of the protocol-http-header >to see what Amazon doesn't like about the authentication. > >HTH > >On Mon, Sep 20, 2010 at 8:37 PM, Graham Chiu <[email protected]> wrote: > >> Hi Carl >> >> I never tested on Linux ... but the forbidden error suggests that the >> authentication is not working. >> As an alternative Chris rewrote this as a protocol. Perhaps try that as >> well? >> >> http://www.ross-gill.com/r/s3http.r >> >> If you find the problem, let me know so I can fix it :) >> >> On Mon, Sep 20, 2010 at 8:22 PM, Carl Read <[email protected]> wrote: >> >>> >>> Hi all, >>> >>> I've got the Amazon S3 tools (see: http://rebol.wik.is/S3 ) to work on >>> Windows XP, but I get a 403 Forbidden error on Linux when using the >>> Get-s3object function to try and download a file. (I've not tried >uploading >>> from Linux yet.) >>> >>> Does anyone know what could be causing the difference in behaviour? (Note >>> I'm no Linux expert.) >>> >>> -- Carl Read. -- To unsubscribe from the list, just send an email to lists at rebol.com with unsubscribe as the subject.
