File Attachment in Flex..

8 views
Skip to first unread message

Krishna kumar

unread,
Dec 17, 2009, 6:45:18 AM12/17/09
to flex_...@googlegroups.com
Hi Friends,
                  I am trying to create a flex  web application  which interacts with servlets.Now i have to upload a file in my flex application which i have to pass it to a servlet.please let me know how to  proceed or whether we can achieve this in flex.

Thanks & Regards
Krishna.

:)

sravan kumar

unread,
Dec 17, 2009, 7:03:40 AM12/17/09
to flex_...@googlegroups.com
hi krishna,
 
find the below code for that:

urlRequest =

new URLRequest();

reqHeaders =

new Array();

reqHeaders.push(

new URLRequestHeader("Content-Type", "multipart/form-data"));

urlRequest.requestHeaders = reqHeaders;

urlRequest.url = "/

TestServlet" ;

urlRequest.method = URLRequestMethod.POST;

try

{

fileUpload.fileReference.upload(urlRequest);

}

catch (error:Error)

{

trace("Unable to upload files." + error);

}

 
and map this servlet in web.xml with actual class


--

You received this message because you are subscribed to the Google Groups "Flex India Community" group.
To post to this group, send email to flex_...@googlegroups.com.
To unsubscribe from this group, send email to flex_india+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/flex_india?hl=en.

Reply all
Reply to author
Forward
0 new messages