FollowRedirects Property
Determines what happens when the server issues a redirect.
Syntax
amazons3.getFollowRedirects([callback]) amazons3.setFollowRedirects( followRedirects, [callback])
Possible Values
0 (frNever), 1 (frAlways), 2 (frSameScheme)
Default Value
0
Callback
The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).
The callback for the getFollowRedirects([callback]) method is defined as:
function(err, data){ }
'err' is the error that occurred. If there was no error, then 'err' is 'null'.
'data' is the value returned by the method.
The callback for the setFollowRedirects([callback]) method is defined as:
function(err){ }
'err' is the error that occurred. If there was no error, then 'err' is 'null'.
'err' has 2 properties which hold detailed information:
err.code err.message
Remarks
Normally, the class returns an error if the server responds with an "Object Moved" message. If FollowRedirects is set to frAlways (1), the new URL for the request is retrieved automatically every time.
If FollowRedirects is set to frSameScheme (2), the new URL is retrieved automatically only if the URL scheme is the same as the original request, otherwise the class fails with an error.
The default value is frNever (0). In this case, redirects are never followed, and the class fails with an error instead.
Data Type
Integer