Answer the question
In order to leave comments, you need to log in
How to send a FileReferense with parameters to the server in Flash(Flex) and get a response?
Hello. In general, there was a need to build one little thing on Flash (Flex). It's just a button, when you click on which the user selects a file, this file is sent to the server with additional parameters like userID and in response receives a link to this file. In general, I received the file through FileReference.browse(), but I don’t know how to send it now with parameters, and even get an answer right away, I tried a bunch of everything. Maybe someone is familiar with Flash (Flex) more than my one day. Thank you.
UPD:
Just send a file with parameters, it turns out:
var request:URLRequest = new URLRequest("http://192.168.0.104:7080/uploadfile");
var variables:URLVariables = new URLVariables();
var header:URLRequestHeader = new URLRequestHeader( "enctype", "multipart/form-data" );
request.requestHeaders.push(header);
equest.method = URLRequestMethod.POST;
variables.user = "Some user";
request.data = variables;
file.upload(request, 'file');
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question