This content has been marked as final. Show 3 replies
You could always post your authentication in the requestURL as headers when you do fileReference.uplode(). Look under the URLRequest.requestHeaders property for more info, also look at URLRequestHeader specifically in the help docs.
Hope that helps you some.
Thanks for the information.. I tried it but it did not work..
uploadRequest = new URLRequest(urlInput.text);
uploadRequest.method = URLRequestMethod.POST;
var variables:URLVariables = new URLVariables();
variables.Authorization = "Basic username:password";
uploadRequest.data = variables;
In the mean time,
I dug out an article which said
"The FileReference.upload() and FileReference.download() methods do not support the URLRequest.requestHeaders parameter."
Also in Adobe document, it said
"The FileReference and FileReferenceList classes also do not provide methods for authentication. With servers that require authentication, you can download files with the Flash® Player browser plug-in, but uploading (on all players) and downloading (on the stand-alone or external player) fails. Listen for FileReference events to determine whether operations complete successfully and to handle errors."
Does this sound right?
The RequestHeaders and the URLVariables are different from each other.
The URLVariables are posted variables to the server. So if you are running a PHP server, you should be getting a variable in the $_POST named "Authorization" with a value of "Basic username:password"
so on the PHP script, you will have $_POST["Authorization"] and you can do whatever you want with the value of that.
just to double check, when you do your
request, is it successfully getting to your server?
But as for the RequestHeaders, the information you have found may be accurate.
Hope I'm some help to ya.